Skip to content

Commit 512aeb4

Browse files
committed
Use array of features
1 parent 9e1a8fe commit 512aeb4

File tree

1 file changed

+5
-3
lines changed
  • packages/edit-site/src/hooks/push-changes-to-global-styles

1 file changed

+5
-3
lines changed

packages/edit-site/src/hooks/push-changes-to-global-styles/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
9494
'typography.fontFamily': 'fontFamily',
9595
};
9696

97+
const SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];
98+
9799
function useChangesToPush( name, attributes ) {
98100
const supports = useSupportedStyles( name );
99101

@@ -213,9 +215,9 @@ function PushChangesToGlobalStylesControl( {
213215
const withPushChangesToGlobalStyles = createHigherOrderComponent(
214216
( BlockEdit ) => ( props ) => {
215217
const blockEditingMode = useBlockEditingMode();
216-
const supportsStyles =
217-
hasBlockSupport( props.name, 'color' ) ||
218-
hasBlockSupport( props.name, 'typography' );
218+
const supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>
219+
hasBlockSupport( props.name, feature )
220+
);
219221

220222
return (
221223
<>

0 commit comments

Comments
 (0)