microsoft / griffel

CSS-in-JS with ahead-of-time compilation ⚡️
https://griffel.js.org
MIT License
1.2k stars 61 forks source link

chore: improve CSS generation #536

Closed layershifter closed 7 months ago

layershifter commented 7 months ago

The PR improves CSS generation inside the webpack loader from @griffel/webpack-extraction-plugin. That makes output shorter and removes special handling for media bucket.

Before

(comments are generated for every rule)

/** @griffel:css-start [d] [{}] **/
.baz { color: orange; }
/** @griffel:css-end **/
/** @griffel:css-start [d] [{}] **/
.foo { color: red; }
/** @griffel:css-end **/
/** @griffel:css-start [d] [{}] **/
.qux { color: magenta; }
/** @griffel:css-end **/

After

(rules are merged into blocks)

/** @griffel:css-start [d] [{}] **/
.baz { color: orange; }
.foo { color: red; }
.qux { color: magenta; }
/** @griffel:css-end **/
github-actions[bot] commented 7 months ago

📊 Bundle size report

🤖 This report was generated against d39accd763497dd2d9c2bf0540cc72b686f92b53