Skip to content

Commit

Permalink
revert generation of class names for shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed Jan 22, 2024
1 parent 82ceb7a commit 9dc33f5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/block-supports/shadow.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function gutenberg_apply_shadow_support( $block_type, $block_attributes ) {
$shadow_block_styles['shadow'] = $preset_shadow ? $preset_shadow : $custom_shadow;

$attributes = array();
$styles = gutenberg_style_engine_get_styles( $shadow_block_styles, array( 'convert_vars_to_classnames' => true ) );
$styles = gutenberg_style_engine_get_styles( $shadow_block_styles );

if ( ! empty( $styles['css'] ) ) {
$attributes['style'] = $styles['css'];
Expand Down
4 changes: 1 addition & 3 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ class WP_Theme_JSON_Gutenberg {
'use_default_names' => false,
'value_key' => 'shadow',
'css_vars' => '--wp--preset--shadow--$slug',
'classes' => array(
'.has-$slug-shadow' => 'box-shadow',
),
'classes' => array(),
'properties' => array( 'box-shadow' ),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function EffectsPanel( {
: [];
const setShadow = ( newValue ) => {
const slug = mergedShadowPresets?.find(
( { shadow: s } ) => s === newValue
( { shadow: shadowName } ) => shadowName === newValue
)?.slug;

onChange(
Expand Down
4 changes: 0 additions & 4 deletions packages/style-engine/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ final class WP_Style_Engine {
'css_vars' => array(
'shadow' => '--wp--preset--shadow--$slug',
),
'classnames' => array(
'has-shadow' => true,
'has-$slug-shadow' => 'shadow',
),
),
),
'dimensions' => array(
Expand Down

0 comments on commit 9dc33f5

Please sign in to comment.