WC_Twenty_Nineteen::custom_colors_css
Filters Twenty Nineteen custom colors CSS.
Method of the class: WC_Twenty_Nineteen{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$result = WC_Twenty_Nineteen::custom_colors_css( $css, $primary_color, $saturation );
- $css(string) (required)
- Base theme colors CSS.
- $primary_color(int) (required)
- The user's selected color hue.
- $saturation(string) (required)
- Filtered theme color saturation level.
WC_Twenty_Nineteen::custom_colors_css() WC Twenty Nineteen::custom colors css code WC 10.5.0
public static function custom_colors_css( $css, $primary_color, $saturation ) {
if ( function_exists( 'register_block_type' ) && is_admin() ) {
return $css;
}
$lightness = absint( apply_filters( 'twentynineteen_custom_colors_lightness', 33 ) );
$lightness = $lightness . '%';
$css .= '
.onsale,
.woocommerce-info,
.woocommerce-store-notice {
background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' );
}
.woocommerce-tabs ul li.active a {
color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' );
box-shadow: 0 2px 0 hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' );
}
';
return $css;
}