From cb108e6c6fe10c28bbae052a26af12f0dcb56faf Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 12 May 2023 12:46:21 +0100 Subject: [PATCH] Like the original hook, flatten props and combine with parsed styles --- assets/js/base/hooks/use-style-props.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/js/base/hooks/use-style-props.ts b/assets/js/base/hooks/use-style-props.ts index 9497a2a242b..792cc2fc8d3 100644 --- a/assets/js/base/hooks/use-style-props.ts +++ b/assets/js/base/hooks/use-style-props.ts @@ -38,18 +38,21 @@ export const useStyleProps = ( props: blockAttributes ): StyleProps => { style: {}, }; - const styleObject = parseStyle( propsObject.style ); + const style = parseStyle( propsObject.style ); const colorProps = getColorClassesAndStyles( { - style: styleObject, + ...propsObject, + style, } as WithStyle ); const borderProps = getBorderClassesAndStyles( { - style: styleObject, + ...propsObject, + style, } as WithStyle ); const spacingProps = getSpacingClassesAndStyles( { - style: styleObject, + ...propsObject, + style, } as WithStyle ); const typographyProps = useTypographyProps( propsObject );