WC_Twenty_Nineteen::custom_colors_css( string $css, int $primary_color, string $saturation )
Filters Twenty Nineteen custom colors CSS.
Description Description
Parameters Parameters
- $css
-
(Required) Base theme colors CSS.
- $primary_color
-
(Required) The user's selected color hue.
- $saturation
-
(Required) Filtered theme color saturation level.
Source Source
File: includes/theme-support/class-wc-twenty-nineteen.php
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;
}