Gathering detailed insights and metrics for postcss-rem
Gathering detailed insights and metrics for postcss-rem
Gathering detailed insights and metrics for postcss-rem
Gathering detailed insights and metrics for postcss-rem
postcss-pxtorem
A CSS post-processor that converts px to rem.
@csstools/postcss-stepped-value-functions
Use round, rem and mod functions in CSS
postcss-pxtransform
PostCSS plugin px 转小程序 rpx及h5 rem 单位
postcss-rem-to-responsive-pixel
Convert rem units to px or rpx units using PostCSS. Based on postcss-pxtorem and postcss-rem-to-pixel, and rewrite with typescript, and support Postcss8
PostCSS plugin to use rem units with optional pixel fallback.
npm install postcss-rem
Typescript
Module System
Node Version
NPM Version
69.1
Supply Chain
97.9
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
19 Stars
30 Commits
4 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Mar 15, 2025
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
postcss-rem@3.0.0
Unpacked Size
5.94 kB
Size
2.55 kB
File Count
5
NPM Version
8.19.2
Node Version
16.18.1
Published on
Nov 10, 2023
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
PostCSS plugin to use rem units with optional pixel fallback. Based on sass-rem.
Breaking change in 3.0: changed default function name to rem-convert
as CSS now use rem()
for calculating the remainder.
See also: startijenn-rem, vanilla JavaScript version.
1.demo { 2 font-size: rem-convert(24px); /* Simple */ 3 padding: rem-convert(5px 10px); /* Multiple values */ 4 margin: rem-convert(10px 0.5rem); /* Existing rem */ 5 border-bottom: rem-convert(1px solid black); /* Multiple mixed values */ 6 box-shadow: rem-convert( 7 0 0 2px #ccc, 8 inset 0 0 5px #eee 9 ); /* Comma-separated values */ 10 text-shadow: rem-convert(1px 1px) #eee, rem-convert(-1px) 0 #eee; /* Alternate use */ 11}
1.demo { 2 font-size: 1.5rem; /* Simple */ 3 padding: 0.3125rem 0.625rem; /* Multiple values */ 4 margin: 0.625rem 0.5rem; /* Existing rem */ 5 border-bottom: 0.0625rem solid black; /* Multiple mixed values */ 6 box-shadow: 0 0 0.125rem #ccc, inset 0 0 0.3125rem #eee; /* Comma-separated values */ 7 text-shadow: 0.0625rem 0.0625rem #eee, -0.0625rem 0 #eee; /* Alternate use */ 8}
With baseline
to 10
(html { font-size: 62.5%; }
) and fallback
to true
:
1.demo { 2 font-size: 24px; 3 font-size: 2.4rem; /* Simple */ 4 padding: 5px 10px; 5 padding: 0.5rem 1rem; /* Multiple values */ 6 margin: 10px 5px; 7 margin: 1rem 0.5rem; /* Existing rem */ 8 border-bottom: 1px solid black; 9 border-bottom: 0.1rem solid black; /* Multiple mixed values */ 10 box-shadow: 0 0 2px #ccc, inset 0 0 5px #eee; 11 box-shadow: 0 0 0.2rem #ccc, inset 0 0 0.5rem #eee; /* Comma-separated values */ 12 text-shadow: 1px 1px #eee, -1px 0 #eee; 13 text-shadow: 0.1rem 0.1rem #eee, -0.1rem 0 #eee; /* Alternate use */ 14}
With convert
to px
(for a lt-ie9 only stylesheet for example):
1.demo { 2 font-size: 24px; /* Simple */ 3 padding: 5px 10px; /* Multiple values */ 4 margin: 10px 8px; /* Existing rem */ 5 border-bottom: 1px solid black; /* Multiple mixed values */ 6 box-shadow: 0 0 2px #ccc, inset 0 0 5px #eee; /* Comma-separated values */ 7 text-shadow: 1px 1px #eee, -1px 0 #eee; /* Alternate use */ 8}
Install with npm i postcss-rem
and use with PostCSS:
1postcss([require("postcss-rem")]);
Example with custom options:
1postcss([ 2 require("postcss-rem")({ 3 name: "convert-rem", // Default to 'rem-convert' 4 baseline: 10, // Default to 16 5 // convert: "px", // Default to 'rem' 6 fallback: true, // Default to false 7 precision: 6, // Default to 5 8 }), 9]);
See PostCSS docs for examples for your environment.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
Found 1/27 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
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
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 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