📜 ⬆️ ⬇️

CSSO (CSS Optimizer) - structural minimization of CSS

CSSO (CSS Optimizer) is a CSS minimizer that performs both minimization without changing the structure and structural minimization in order to get as little text as possible.
CSSO is written in Javascript and runs both in the browser and on the command line (using NodeJS).
Distributed under the MIT license.

What can


Minimization without changing the structure:Minimization with restructuring:

Where to find


References:Attention : the project is in beta status and may contain flaws and errors. Most likely, the repository and hosting addresses for the web interface will change in the future. The announcement is intended to introduce the public with a new CSS minimizer at an early stage, collect feedback, correct missed errors and make CSSO easier for the user.

Why another minimizer


Most of today's popular minimizers ( YUICompressor and others like it) are minimization without parsing and analyzing the structure. Roughly speaking, a set of regexps replace X with a smaller Y.

Example:
.test { color: red }
.test { color: green }

Processing regexp'ami:
.test{color:red}.test{color:green}

Processing with structure minimization:
.test{color:green}

This is the difference. And if the benefits are not so obvious on small and manually minimized CSS, then on automatically created stylesheets, the gain can be kilobytes.
')
Ps. Documentation and even JsDoc in Russian. There will be English.

Source: https://habr.com/ru/post/116880/


All Articles