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.

Built from https://develop.svn.wordpress.org/trunk@39386


git-svn-id: http://core.svn.wordpress.org/trunk@39326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
David A. Kennedy 2016-11-30 22:51:42 +00:00
parent ba18343ae6
commit d21272ae29
2 changed files with 12 additions and 2 deletions

View File

@ -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 );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39384';
$wp_version = '4.8-alpha-39386';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.