Skip to content

Commit

Permalink
Reset specificity of body selector when processing with postcss. (#60266
Browse files Browse the repository at this point in the history
)

Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
3 people authored Mar 28, 2024
1 parent 99b8ea6 commit 873b7bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-editor/src/utils/transform-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function transformStyle(
return css;
}

const postcssFriendlyCSS = css.replace( ':where(body)', 'body' );
try {
return postcss(
[
Expand All @@ -31,7 +32,7 @@ function transformStyle(
} ),
baseURL && rebaseUrl( { rootUrl: baseURL } ),
].filter( Boolean )
).process( css, {} ).css; // use sync PostCSS API
).process( postcssFriendlyCSS, {} ).css; // use sync PostCSS API
} catch ( error ) {
if ( error instanceof CssSyntaxError ) {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit 873b7bc

Please sign in to comment.