Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp-scripts: minification of CSS imports is done too early in the process #61112

Open
benoitchantre opened this issue Apr 25, 2024 · 0 comments · May be fixed by #61121
Open

wp-scripts: minification of CSS imports is done too early in the process #61112

benoitchantre opened this issue Apr 25, 2024 · 0 comments · May be fixed by #61121
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@benoitchantre
Copy link
Contributor

What problem does this address?

CSS files that are imported are minified, but the minification happens to early.
Each imported file is minified, but there's a line break between each import in the resulting file.

This is an improvement of #56516.

Example:

Content of global.css

@import "_reset.css";
@import "_typography.css";

Result

*,:after,:before{box-sizing:border-box}
:where(h1,h2,.has-large-font-size,.has-x-large-font-size,.has-xx-large-font-size){text-wrap:balance}

Expected result

*,:after,:before{box-sizing:border-box}:where(h1,h2,.has-large-font-size,.has-x-large-font-size,.has-xx-large-font-size){text-wrap:balance}

What is your proposed solution?

Adjust the webpack.config.js to use postcss-import before cssnano

@benoitchantre benoitchantre added the [Type] Enhancement A suggestion for improvement. label Apr 25, 2024
benoitchantre added a commit to benoitchantre/gutenberg that referenced this issue Apr 25, 2024
@benoitchantre benoitchantre linked a pull request Apr 25, 2024 that will close this issue
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 25, 2024
benoitchantre added a commit to benoitchantre/gutenberg that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant