suitcss / suit

Style tools for UI components
http://suitcss.github.io/
3.8k stars 229 forks source link

how can i minify classname with postcss or webpack #136

Closed yuchuanxi closed 8 years ago

yuchuanxi commented 8 years ago

when i use SUIT, the className become long, and i wan't to minify the className in production

like: before minify

// style.css
.Excerpt-thumbnail {
....
}
// index.html
<div class="Excerpt-thumbnail"></div>

after minify

// style.css
.a {
....
}
// index.html
<div class="a"></div>
timkelty commented 8 years ago

You may be able to use css-loader / local scope to achieve this. You'd still need something to sort through your templates and change class names, however.

In general, I think you will find using gzip to serve these resources will be more than enough to compensate for the extra characters in a production environment.

yuchuanxi commented 8 years ago

@timkelty thanks

vreshch commented 7 years ago

You can try to look over this https://github.com/vreshch/optimize-css-classnames-plugin