What is csso?
CSSO (CSS Optimizer) is a CSS minifier. It performs three kinds of optimizations: structural optimizations, reducing CSS size by merging blocks with identical properties, removing overridden properties, etc.; cleaning (removing unused @media rules, cutting out the comments, etc.); and compressing (transforming values to shorter forms, merging identical selectors, etc.). It can be used as a command-line tool or as a library.
What are csso's main functionalities?
Minification
Minifies CSS by removing whitespace, comments, and making other optimizations to reduce file size.
const csso = require('csso');
const minifiedCss = csso.minify('.test { color: #ff0000; }').css;
Structural Optimization
Optimizes CSS structure by merging blocks with identical properties and removing overridden properties.
const csso = require('csso');
const optimizedCss = csso.minify('.test { color: red; } .test { font-size: 16px; }', { restructure: true }).css;
Source Map Generation
Generates a source map that can be used to debug the minified CSS by mapping it back to the original sources.
const csso = require('csso');
const result = csso.minify('.test { color: red; }', { sourceMap: true });
const minifiedCss = result.css;
const map = result.map.toString();
Other packages similar to csso
clean-css
clean-css is a fast and efficient CSS optimizer for Node.js and the Web. It provides similar minification capabilities as CSSO but also offers advanced optimizations like restructuring.
uglifycss
uglifycss is a CSS minifier that aims to be fast and simple. It doesn't have as many features as CSSO, focusing mainly on removing whitespace and comments to compress CSS files.
purifycss
purifycss is a tool to remove unused CSS. Unlike CSSO, which focuses on optimizing existing CSS, purifycss analyzes your content and CSS files to remove unused selectors.

English
CSSO (CSS Optimizer) is a CSS minimizer unlike others. In addition to usual minification techniques it can perform structural optimization of CSS files, resulting in smaller file size compared to other minifiers.
See detailed information on bem.info/tools/optimizers/csso.
中文
CSSO (CSS 优化器) 是一个与众不同的CSS代码压缩器。相比其他压缩器,除了常用的压缩技术外,它还会通过重建CSS代码结构信息的优化技术从而使文件压缩到更小的尺寸。
访问bem.info/tools/optimizers/csso获取更详细的信息。
日本語
CSSO (CSSオプティマイザー)は、他とは違ったCSS縮小化ツールです。 一般的な縮小化テクニックに加えてCSSファイルの構造的な最適化も行うので、 他の縮小化ツールと比べてより軽量にすることが可能です。
詳細な情報はbem.info/tools/optimizers/cssoを参照してください。
Русский
CSSO (CSS Optimizer) является минимизатором CSS, выполняющим как минимизацию без изменения структуры, так и структурную минимизацию с целью получить как можно меньший текст.
Детальное описание смотри на ru.bem.info/tools/optimizers/csso.
Українська
CSSO (CSS Optimizer) є CSS-мінімізатор не схожий на інші. На додачу до звичайних технік мініфікації він може виконувати й структурну оптимізацію файлів CSS, що дозволяє отримати менший розмір файлу, в порівнянні з іншими мініфікаторами.
Детальнішу інформацію шукайте на bem.info/tools/optimizers/csso.
한국어
CSSO (CSS Optimizer)는 다른 CSS압축툴과는 다릅니다. 일반적인 압축 기법에 더불어 CSS파일의 구조를 최적화하여 다른 툴에 비해 더 작은 파일로 만들 수 있습니다.
상세한 정보는 bem.info/tools/optimizers/csso를 참고바랍니다.