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

Commit

Permalink
Like the original hook, flatten props and combine with parsed styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed May 12, 2023
1 parent 8dd3c1e commit cd6add0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/js/base/hooks/use-style-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit cd6add0

Please sign in to comment.