CSSO (CSS Optimizer) - structural CSS minimization
CSSO (CSS Optimizer) is a CSS minimizer that performs both minimization without changing the structure and structural minimization in order to get the smallest text possible.
CSSO is written in Javascript, executed both in the browser and on the command line (using NodeJS).
Distributed under the MIT license.
Minimization without changing the structure:
References:
Most of today's popular minimizers ( YUICompressor and the like) are minimization without analysis and structure analysis. Roughly speaking, the set of regexp is replaced by X with a smaller Y.
Example: Processing by regexp: Processing with minimizing the structure: This is the difference. And if on small and manually minimized CSS the benefits are not so obvious, then on automatically created style sheets the gain can be kilobytes. PS. Documentation and even JsDoc in Russian. There will be English.
CSSO is written in Javascript, executed both in the browser and on the command line (using NodeJS).
Distributed under the MIT license.
What can
Minimization without changing the structure:
- Whitespace removal
- Removing trailing ';'
- Removing Comments
- Removing the wrong charset and import
- Delete erroneous items
- Color minimization
- Minimization 0
- Minimizing margin and padding
- Merge multi-line strings into single-line
- Font-weight minimization
- Merging blocks with the same selectors
- Removing overlapping properties
- Partial allocation of properties in a separate block
- Partial Block Merge
Where to find
References:
- Web interface for tests and trials: anotherfelix.com/csso/web/csso.html
- Source Code Repository: github.com/afelix/csso
- Installation Guide: github.com/afelix/csso/blob/master/README.md
- CSS minimization description: github.com/afelix/csso/blob/master/MANUAL.ru.md
Why another minimizer
Most of today's popular minimizers ( YUICompressor and the like) are minimization without analysis and structure analysis. Roughly speaking, the set of regexp is replaced by X with a smaller Y.
Example: Processing by regexp: Processing with minimizing the structure: This is the difference. And if on small and manually minimized CSS the benefits are not so obvious, then on automatically created style sheets the gain can be kilobytes. PS. Documentation and even JsDoc in Russian. There will be English.
.test { color: red }
.test { color: green }
.test{color:red}.test{color:green}.test{color:green}