Skip to content

Commit

Permalink
Another spread fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed May 22, 2024
1 parent b298d91 commit 8756450
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,24 @@ export default function StyleVariationsContainer( { gap = 2 } ) {
} );
}
// Now merge any global custom CSS from current user styles with global custom CSS in the variation.
const globalCustomCSS =
const css =
userStyles?.css || variation.styles?.css
? `${ variation.styles?.css || '' } ${
userStyles?.css || ''
}`
: '';
? {
css: `${ variation.styles?.css || '' } ${
userStyles?.css || ''
}`,
}
: {};

const blocks =
Object.keys( blockStyles ).length > 0
? { blocks: blockStyles }
: {};

const styles = {
...variation.styles,
css: globalCustomCSS,
blocks: {
...blockStyles,
},
...css,
...blocks,
};
return {
...variation,
Expand Down

0 comments on commit 8756450

Please sign in to comment.