Skip to content

Commit

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

Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
3 people authored and cbravobernal committed Apr 9, 2024
1 parent 8709d13 commit 16ac520
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 16ac520

Please sign in to comment.