Skip to content

Commit 144c52e

Browse files
Prevent mutating feature selectors
1 parent eb88cc1 commit 144c52e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/block-editor/src/components/global-styles/use-global-styles-output.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ function scopeFeatureSelectors( scope, selectors ) {
612612
return;
613613
}
614614

615-
const featureSelectors = { ...selectors };
615+
const featureSelectors = JSON.parse( JSON.stringify( selectors ) );
616616

617617
Object.entries( selectors ).forEach( ( [ feature, selector ] ) => {
618618
if ( typeof selector === 'string' ) {
@@ -948,6 +948,7 @@ export const toStyles = (
948948
baseSelector,
949949
styleVariationSelector
950950
);
951+
951952
const rules =
952953
declarations.join( ';' );
953954
ruleset += `${ cssSelector }{${ rules };}`;

0 commit comments

Comments
 (0)