
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
postcss-plugin-pr2rem
Advanced tools
postcss plugin pr2rem.
A plugin for PostCSS that generates rem units from pixel units.
$ npm i --save postcss-plugin-pr2rem
// input
h1 {
margin: 0 10px 0 20pr;
font-size: 32pr;
line-height: 1.2;
letter-spacing: 1px;
}
// output
h1 {
margin: 0 10px 0 0.2rem;
font-size: 0.32rem;
line-height: 1.2;
letter-spacing: 0.01rem;
}
import { writeFile, readFileSync } from 'fs';
import postcss from 'postcss';
import pxtorem from 'postcss-plugin-px2rem';
const css = readFileSync('/path/to/test.css', 'utf8');
const options = {
replace: false,
};
const processedCss = postcss(pxtorem(options)).process(css).css;
writeFile('/path/to/test.rem.css', processedCss, err => {
if (err) throw err;
console.log('Rem file written.');
});
const px2rem = require('postcss-plugin-px2rem');
const px2remConfig = {
// 设计图为1242px
rootValue: 62.1,
unitPrecision: 5,
propWhiteList: [],
propBlackList: ['font-size'],
selectorBlackList: [],
ignoreIdentifier: '00',
replace: true,
mediaQuery: false,
minPixelValue: 0
};
module.exports = {
plugins: [
px2rem(px2remConfig)
]
};
Default:
{
rootValue: 100,
unitPrecision: 5,
propWhiteList: [],
propBlackList: [],
selectorBlackList: [],
ignoreIdentifier: false,
replace: true,
mediaQuery: false,
minPixelValue: 0
}
rootValue (Number|Object) The root element font size. Default is 100.
{ px: 50, rpx: 100 }, it will
replace rpx to 1/100 rem , and px to 1/50 rem.unitPrecision (Number) The decimal numbers to allow the REM units to grow to.propWhiteList (Array) The properties that can change from px to rem.
propBlackList (Array) The properties that should not change from px to rem.
selectorBlackList (Array) The selectors to ignore and leave as px.
['body'] will match .body-class[/^body$/] will match body but not .bodyignoreIdentifier (Boolean/String) a way to have a single property ignored, when ignoreIdentifier enabled, then replace would be set to true automatically.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.MIT
ant-tool/postcss-plugin-px2rem
FAQs
A plugin for PostCSS that generates rem units from multi units.
We found that postcss-plugin-pr2rem demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.