Installations
npm install precss
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=4.0.0
Node Version
11.1.0
NPM Version
6.4.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
CSS (57.6%)
JavaScript (42.4%)
Developer
Download Statistics
Total Downloads
40,423,110
Last Day
14,273
Last Week
62,256
Last Month
279,066
Last Year
3,589,045
GitHub Statistics
1,608 Stars
82 Commits
77 Forks
33 Watching
2 Branches
15 Contributors
Bundle Size
1.94 MB
Minified
249.26 kB
Minified + Gzipped
Package Meta Information
Latest Version
4.0.0
Package Id
precss@4.0.0
Size
6.07 kB
NPM Version
6.4.1
Node Version
11.1.0
Publised On
23 Nov 2018
Total Downloads
Cumulative downloads
Total Downloads
40,423,110
Last day
5.9%
14,273
Compared to previous day
Last week
-15.2%
62,256
Compared to previous week
Last month
0.3%
279,066
Compared to previous month
Last year
-26.5%
3,589,045
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
PreCSS
PreCSS lets you use Sass-like markup and staged CSS features in CSS.
1$blue: #056ef0; 2$column: 200px; 3 4.menu { 5 width: calc(4 * $column); 6} 7 8.menu_link { 9 background: $blue; 10 width: $column; 11} 12 13/* becomes */ 14 15.menu { 16 width: calc(4 * 200px); 17} 18 19.menu_link { 20 background: #056ef0; 21 width: 200px; 22}
PreCSS combines Sass-like syntactical sugar — like variables, conditionals, and iterators — with emerging CSS features — like logical and custom properties, media query ranges, and image sets.
Usage
Add PreCSS to your build tool:
1npm install precss --save-dev
Node
Use PreCSS to process your CSS:
1import precss from 'precss'; 2 3precss.process(YOUR_CSS);
PostCSS
Add PostCSS to your build tool:
1npm install postcss --save-dev
Use PreCSS as a plugin:
1import postcss from 'postcss'; 2import precss from 'precss'; 3 4postcss([ 5 precss(/* options */) 6]).process(YOUR_CSS);
Gulp
Add Gulp PostCSS to your build tool:
1npm install gulp-postcss --save-dev
Use PreCSS in your Gulpfile:
1import postcss from 'gulp-postcss'; 2import precss from 'precss'; 3 4gulp.task('css', function () { 5 return gulp.src('./src/*.css').pipe( 6 postcss([ 7 precss(/* options */) 8 ]) 9 ).pipe( 10 gulp.dest('.') 11 ); 12});
Grunt
Add Grunt PostCSS to your build tool:
1npm install grunt-postcss --save-dev
Use PreCSS in your Gruntfile:
1import precss from 'precss'; 2 3grunt.loadNpmTasks('grunt-postcss'); 4 5grunt.initConfig({ 6 postcss: { 7 options: { 8 use: [ 9 precss(/* options */) 10 ] 11 }, 12 dist: { 13 src: '*.css' 14 } 15 } 16});
Plugins
PreCSS is powered by the following plugins (in this order):
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: Creative Commons Zero v1.0 Universal: LICENSE.md:0
Reason
Found 5/27 approved changesets -- score normalized to 1
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 9 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2025-01-27
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