Get the CSS for global styles.
Description
Example output: body{–wp–preset–duotone–blue-orange:url(‘#wp-duotone-blue-orange’);}
Parameters
$sources
arrayrequired- The duotone presets.
Source
private static function get_global_styles_presets( $sources ) {
$css = WP_Theme_JSON::ROOT_CSS_PROPERTIES_SELECTOR . '{';
foreach ( $sources as $filter_id => $filter_data ) {
$slug = $filter_data['slug'];
$colors = $filter_data['colors'];
$css_property_name = self::get_css_custom_property_name( $slug );
$declaration_value = is_string( $colors ) ? $colors : self::get_filter_url( $filter_id );
$css .= "$css_property_name:$declaration_value;";
}
$css .= '}';
return $css;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.