thysultan / stylis

light – weight css preprocessor
https://stylis.js.org
MIT License
1.74k stars 84 forks source link

Make tiny optimization to our CSS compiler to avoid extra trailing `;` #20

Closed giuseppeg closed 7 years ago

giuseppeg commented 7 years ago

This is definitely a nice-to-have (not a big deal) but we could get rid of extra spaces and trailing ; for smaller footprint.

thysultan commented 7 years ago

So

h1 {
color: red;
}

would output

h1{color:red}

At the moment it produces

h1 {color: red;}

Would love to add this as an option in the rewrite https://github.com/thysultan/stylis.js/tree/master/rewrite

Which supports styled-jsx cascade isolation out of the box as an option

stylis.set({
    cascade: false
})
giuseppeg commented 7 years ago

@thysultan exactly! h1{color:red}.

Which supports styled-jsx cascade isolation out of the box as an option

😍 this is amazing!

thysultan commented 7 years ago

Sure, i'll try to explore two routes with further minification ex. basic – whitespace, trailing semi's, and aggressive, – removing duplicate selector blocks.

giuseppeg commented 7 years ago

ok thanks, again it is just a nice to have so nothing to prioritize.

thysultan commented 7 years ago

@giuseppeg This landed in V3