Gathering detailed insights and metrics for postcss-csso
Gathering detailed insights and metrics for postcss-csso
Gathering detailed insights and metrics for postcss-csso
Gathering detailed insights and metrics for postcss-csso
npm install postcss-csso
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
119 Stars
76 Commits
6 Forks
3 Watching
3 Branches
3 Contributors
Updated on 05 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-16.9%
6,305
Compared to previous day
Last week
-2.8%
34,029
Compared to previous week
Last month
5.7%
150,524
Compared to previous month
Last year
32.8%
1,482,178
Compared to previous year
PostCSS plugin to minify CSS using CSSO (a CSS minifier with structural optimizations).
Under the hood, the plugin converts PostCSS
AST into CSSO
's AST, optimises it and converts back. The plugin uses PostCSS
's input AST nodes (or their clones) on back convertation, so the shape of the original PostCSS
's nodes is preserved after the compression in most cases (e.g. properties added by other plugins aren't lost). This approach makes it possible to achieve great performance and correct source maps generation.
The performance of postcss-csso
is approximately the same as CSSO
has itself (see CSSO
numbers in minifiers comparison table).
If you have any difficulties with the output of this plugin, please use the CSSO tracker.
npm install postcss-csso
1import postcss from 'postcss'; 2import csso from 'postcss-csso'; 3// CommonJS: 4// const csso = require('postcss-csso'); 5 6postcss([ csso]) 7 .process('.a { color: #FF0000; } .b { color: rgba(255, 0, 0, 1) }') 8 .then((result) => { 9 console.log(result.css); 10 // .a,.b{color:red} 11 });
Plugin takes the same options as compress()
method of CSSO with no exception.
1postcss([ 2 csso({ restructure: false }) 3]) 4 .process('.a { color: #FF0000; } .b { color: rgba(255, 0, 0, 1) }') 5 .then((result) => { 6 console.log(result.css); 7 // .a{color:red}.b{color:red} 8 });
Using in postcss.config.js
:
1import csso from 'postcss-csso'; 2 3export const plugins = [ 4 csso({ 5 restructure: false 6 }) 7];
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
7 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More