Gathering detailed insights and metrics for postcss-pxtorem-multi
Gathering detailed insights and metrics for postcss-pxtorem-multi
Gathering detailed insights and metrics for postcss-pxtorem-multi
Gathering detailed insights and metrics for postcss-pxtorem-multi
Convert pixel units to rem (root em) units using PostCSS
npm install postcss-pxtorem-multi
Typescript
Module System
Node Version
NPM Version
71.3
Supply Chain
98.4
Quality
74.9
Maintenance
50
Vulnerability
100
License
JavaScript (97%)
CSS (3%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
57 Commits
2 Branches
1 Contributors
Updated on Apr 03, 2024
Minified
Minified + Gzipped
Latest Version
1.0.2
Package Id
postcss-pxtorem-multi@1.0.2
Unpacked Size
30.78 kB
Size
6.55 kB
File Count
13
NPM Version
6.4.1
Node Version
10.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
This is a fork based on postcss-pxtorem. The difference is postcss-pxtorem-multi
supports multiple rules.
1$ npm install postcss-pxtorem-multi --save-dev
Type: Object | Null
Default:
1{ 2 include: null, 3 exclude: null, 4 rootValue: 16, 5 unitPrecision: 5, 6 propList: ['font', 'font-size', 'line-height', 'letter-spacing'], 7 selectorBlackList: [], 8 replace: true, 9 mediaQuery: false, 10 minPixelValue: 0, 11 rules: [] 12}
include
(String|RegExp|Array<String|RegExp>) Files to includeexclude
(String|RegExp|Array<String|RegExp>) Files to excluderootValue
(Number) The root element font size.unitPrecision
(Number) The decimal numbers to allow the REM units to grow to.propList
(Array) The properties that can change from px to rem.
*
to enable all properties. Example: ['*']
*
at the start or end of a word. (['*position*']
will match background-position-y
)!
to not match a property. Example: ['*', '!letter-spacing']
['*', '!font*']
selectorBlackList
(Array) The selectors to ignore and leave as px.
['body']
will match .body-class
[/^body$/]
will match body
but not .body
replace
(Boolean) replaces rules containing rems instead of adding fallbacks.mediaQuery
(Boolean) Allow px to be converted in media queries.minPixelValue
(Number) Set the minimum pixel value to replace.rules
: (Object) Supporting all the above parameters.1var gulp = require('gulp'); 2var postcss = require('gulp-postcss'); 3var pxtorem = require('postcss-pxtorem-multi'); 4 5gulp.task('css', function () { 6 7 var processors = [ 8 pxtorem({ 9 rootValue: 16, 10 rules: [ 11 { 12 include: 'common.css', 13 rootValue: 32, 14 } 15 ] 16 }) 17 ]; 18 19 return gulp.src(['build/css/**/*.css']) 20 .pipe(postcss(processors)) 21 .pipe(gulp.dest('build/css')); 22});
postcss.config.js
or .postcssrc.js
1module.exports = { 2 plugins: { 3 "postcss-pxtorem-multi": { 4 rootValue: 75, 5 propList: ['*'], 6 rules: [ 7 { 8 include: ['/node_modules/vant/'], 9 rootValue: 37.5, 10 propList: ['*'], 11 } 12 ] 13 } 14 } 15}
Currently, the easiest way to have a single property ignored is to use a capital in the pixel unit declaration.
1// `px` is converted to `rem` 2.convert { 3 font-size: 16px; // converted to 1rem 4} 5 6// `Px` or `PX` is ignored by `postcss-pxtorem-multi` but still accepted by browsers 7.ignore { 8 border: 1Px solid; // ignored 9 border-width: 2PX; // ignored 10}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-05-05
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