cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

Issue with SheetRegistry.toString({format: false}) minifyer - part of the css is not minified #1566

Open armen665 opened 3 years ago

armen665 commented 3 years ago

Expected behavior: Minify all the server-side CSS.

Describe the bug: Font faces and CSS variables are not getting minified In Next.js app.

Reproduction: Create CSS file with CSS variables and font faces, and get the registry string with Registry.toString({format: false})

Versions (please complete the following information):

Managing expectations:

Maintainers will not be fixing the problem you have unless they have it too, if you want it to get fixed:

  1. Submit a PR with a failing test
  2. Discuss a solution
  3. Implement it

You can also do the first step only and wait for someone else to work on a fix. Anything is much better than nothing.

kof commented 3 years ago

cc @briganti

briganti commented 3 years ago

@armen665 can you provide a sandbox where I can reproduce the issue?

kof commented 3 years ago

I think he is saying that font faces are not getting minified.

armen665 commented 3 years ago

Yes, font faces and css variables are not getting minified.

briganti commented 3 years ago

Found it, the format option doesn't work with @global rule. PR incoming .

kof commented 3 years ago

@armen665 can you confirm this was only happening with global rule?

armen665 commented 3 years ago

@kof yes, in my case globals are not minified, everything else is minified properly.

armen665 commented 3 years ago

@kof @briganti thank you for your quick actions.

armen665 commented 3 years ago

Could you please tell when this will be live?