From 856cd3af71bf1f7653a3ed9e13f30f68dc44f57d Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Wed, 30 Nov 2016 22:50:40 +0000 Subject: [PATCH] Twenty Seventeen: Allow child themes to easily extend custom color patterns By adding a filter, child themes can add additional selectors onto the custom color scheme CSS. Like so: {{{ // Add child theme selectors for color schemes. function dynamic_seventeen_custom_colors_css( $css, $hue, $saturation ) { $css .= ' .colors-custom .content-menu > article:not(.has-post-thumbnail), .colors-custom .content-menu > section:not(.has-post-thumbnail) { border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ }'; return $css; } add_filter( 'twentyseventeen_custom_colors_css', 'dynamic_seventeen_custom_colors_css', 10, 3 ); }}} Props celloexpressions. Fixes #38949. git-svn-id: https://develop.svn.wordpress.org/trunk@39386 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyseventeen/inc/color-patterns.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentyseventeen/inc/color-patterns.php b/src/wp-content/themes/twentyseventeen/inc/color-patterns.php index c3913e1e6b..a59e64457f 100644 --- a/src/wp-content/themes/twentyseventeen/inc/color-patterns.php +++ b/src/wp-content/themes/twentyseventeen/inc/color-patterns.php @@ -557,5 +557,15 @@ body.colors-custom, } }'; - return $css; + + /** + * Filters Twenty Seventeen custom colors CSS. + * + * @since Twenty Seventeen 1.0 + * + * @param $css string Base theme colors CSS. + * @param $hue int The user's selected color hue. + * @param $saturation string Filtered theme color saturation level. + */ + return apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation ); }