Given the block settings, extracts the CSS Custom Properties for the presets and adds them to the $declarations array following the format:
Description
array( ‘name’ => ‘property_name’, ‘value’ => ‘property_value, )
Parameters
$settings
arrayrequired- Settings to process.
$origins
string[]required- List of origins to process.
Source
// Skip outputting base styles for flow and constrained layout types if theme doesn't support theme.json. The 'base-layout-styles' type flags this.
if ( in_array( 'base-layout-styles', $types, true ) && ( 'default' === $layout_definition['name'] || 'constrained' === $layout_definition['name'] ) ) {
continue;
}
if (
isset( $base_style_rule['selector'] ) &&
preg_match( $layout_selector_pattern, $base_style_rule['selector'] ) &&
! empty( $base_style_rule['rules'] )
) {
foreach ( $base_style_rule['rules'] as $css_property => $css_value ) {
// Skip rules that reference content size or wide size if they are not defined in the theme.json.
if (
is_string( $css_value ) &&
User Contributed Notes
You must log in before being able to contribute a note or feedback.