Skip to content

Commit

Permalink
update the structure of shadow support
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed Jan 31, 2024
1 parent 520a982 commit fb43c6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Expand Up @@ -51,7 +51,7 @@ Prompt visitors to take action with a button-style link. ([Source](https://githu
- **Name:** core/button
- **Category:** design
- **Parent:** core/buttons
- **Supports:** anchor, color (background, gradients, text), shadow, spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~align~~, ~~reusable~~
- **Supports:** anchor, color (background, gradients, text), shadow (), spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~align~~, ~~reusable~~
- **Attributes:** backgroundColor, gradient, linkTarget, placeholder, rel, tagName, text, textAlign, textColor, title, type, url, width

## Buttons
Expand Down
14 changes: 9 additions & 5 deletions packages/block-editor/src/hooks/style.js
Expand Up @@ -27,7 +27,11 @@ import {
SPACING_SUPPORT_KEY,
DimensionsPanel,
} from './dimensions';
import { EFFECTS_SUPPORT_KEYS, EffectsPanel } from './effects';
import {
EFFECTS_SUPPORT_KEYS,
SHADOW_SUPPORT_KEY,
EffectsPanel,
} from './effects';
import {
shouldSkipSerialization,
useStyleOverride,
Expand Down Expand Up @@ -99,10 +103,7 @@ function addAttribute( settings ) {
* @type {Record<string, string[]>}
*/
const skipSerializationPathsEdit = {
[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
'border',
'shadow',
],
[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],
[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
COLOR_SUPPORT_KEY,
],
Expand All @@ -115,6 +116,9 @@ const skipSerializationPathsEdit = {
[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
SPACING_SUPPORT_KEY,
],
[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
SHADOW_SUPPORT_KEY,
],
};

/**
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/button/block.json
Expand Up @@ -98,7 +98,9 @@
}
},
"reusable": false,
"shadow": true,
"shadow": {
"__experimentalSkipSerialization": true
},
"spacing": {
"__experimentalSkipSerialization": true,
"padding": [ "horizontal", "vertical" ],
Expand Down

0 comments on commit fb43c6e

Please sign in to comment.