Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Product Button and Rating: Allow margin styles in WC core (#8280)
Browse files Browse the repository at this point in the history
* Product Button and Rating: Allow margin styles in WC core.

* Product Button: Fix spacing logic.
  • Loading branch information
danieldudzic authored Jan 27, 2023
1 parent 7168ff4 commit 2976e87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions assets/js/atomic/blocks/product-elements/button/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ export const supports = {
__experimentalSelector:
'.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button',
} ),
...( typeof __experimentalGetSpacingClassesAndStyles === 'function' &&
! isFeaturePluginBuild() && {
spacing: {
margin: true,
},
} ),
};
11 changes: 5 additions & 6 deletions assets/js/atomic/blocks/product-elements/rating/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ export const supports = {
fontSize: true,
__experimentalSkipSerialization: true,
},
...( typeof __experimentalGetSpacingClassesAndStyles === 'function' && {
spacing: {
margin: true,
__experimentalSkipSerialization: true,
},
} ),
__experimentalSelector: '.wc-block-components-product-rating',
} ),
...( typeof __experimentalGetSpacingClassesAndStyles === 'function' && {
spacing: {
margin: true,
},
} ),
};

0 comments on commit 2976e87

Please sign in to comment.