From 2976e8786c0ef96321368a105e606e1b63a2faf4 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Fri, 27 Jan 2023 12:13:42 +0100 Subject: [PATCH] Product Button and Rating: Allow margin styles in WC core (#8280) * Product Button and Rating: Allow margin styles in WC core. * Product Button: Fix spacing logic. --- .../atomic/blocks/product-elements/button/supports.ts | 6 ++++++ .../atomic/blocks/product-elements/rating/support.ts | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/assets/js/atomic/blocks/product-elements/button/supports.ts b/assets/js/atomic/blocks/product-elements/button/supports.ts index 00db65027b1..048625ee61a 100644 --- a/assets/js/atomic/blocks/product-elements/button/supports.ts +++ b/assets/js/atomic/blocks/product-elements/button/supports.ts @@ -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, + }, + } ), }; diff --git a/assets/js/atomic/blocks/product-elements/rating/support.ts b/assets/js/atomic/blocks/product-elements/rating/support.ts index f68350a0581..6ae7b413f5d 100644 --- a/assets/js/atomic/blocks/product-elements/rating/support.ts +++ b/assets/js/atomic/blocks/product-elements/rating/support.ts @@ -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, + }, + } ), };