css / csso

CSS minifier with structural optimizations
https://css.github.io/csso/csso.html
MIT License
3.74k stars 187 forks source link

Enable structure optimization features one by one #254

Open cmolina opened 8 years ago

cmolina commented 8 years ago

For example, it would be nice to use all the structural optimizations, but to avoid Removal of overridden properties to give a fallback to browsers that do not support some feature.

lahmatiy commented 8 years ago

Hi! csso tries to be as smart as possible. Sometimes it works incorrect especially in structural optimizations, that's why option to disable it exists. But this option mostly a workaround, temporary solution until reported bug is fixed. Currently I'm reworking compressor to make it simple, fast and easy to maintain. Next step is make it correct all the time, i.e. to make safe optimizations only with all known nuances about how does CSS works, which sometimes missed by csso and similar tools. So, I believe, options to disable something is not required in future. Instead, options to allow more aggresive optimization could be added in next releases. Settings to define level of desired browsers support (legacy, modern, edge) also could be added.