سؤال

I am using SASS and it has a "compressed" output style. It minifies CSS pretty well.

Is the CSS more compressed than other pure CSS alternatives like Clean CSS for example?

CSS minifiers benchmark: http://goalsmashers.github.io/css-minification-benchmark/

هل كانت مفيدة؟

المحلول

The SASS compressed output style only does some relatively basic compression. From the SASS docs:

Compressed style takes up the minimum amount of space possible, having no whitespace except that necessary to separate selectors and a newline at the end of the file. It also includes some other minor compressions, such as choosing the smallest representation for colors. It’s not meant to be human-readable.

It looks like clean-css does some more advanced optimization like combining selectors that share properties, so in theory it should be better than the SASS compressed output style. How much better it is depends on how you write your selectors and how complex your stylesheet is.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top