
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
postcss-pixel-to-remvw
Advanced tools
a postcss plugin for converting px to rem and vw, also you can choose only convert one of then.
This version requires postcss
version 8
For postcss v7, you have to use postcss-pixel-to-remvw v1
npm install postcss-pixel-to-remvw -D
h1 {
margin: 0 0 20px 20px;
font-size: 32px;
line-height: 1.2;
letter-spacing: 1px;
}
h1 {
margin: 0 0 0.26667rem 0.26667rem;
margin: 0 0 2.66667vw 2.66667vw;
font-size: 0.42667rem;
font-size: 4.26667vw;
line-height: 1.2;
letter-spacing: 0.01333rem;
letter-spacing: 0.13333vw;
}
Now, the disabled convert marker does not have to be at the top of the file, you can place it outside any root-level node
/*disable-convert*/
h1 {
margin: 0 0 20px 20px;
font-size: 32px;
line-height: 1.2;
letter-spacing: 1px;
}
/*disable-convert*/
h1 {
margin: 0 0 20px 20px;
font-size: 32px;
line-height: 1.2;
letter-spacing: 1px;
}
/*disable-convert-vw*/
h1 {
margin: 0 0 20px 20px;
font-size: 32px;
line-height: 1.2;
letter-spacing: 1px;
}
/*disable-convert-vw*/
h1 {
margin: 0 0 0.26667rem 0.26667rem;
font-size: 0.42667rem;
line-height: 1.2;
letter-spacing: 0.01333rem;
}
/*disable-convert-vw*/
h1 {
margin: 0 0 20px 20px;
font-size: 32px; /*no*/
line-height: 1.2;
letter-spacing: 1px;
}
/*disable-convert-vw*/
h1 {
margin: 0 0 0.26667rem 0.26667rem;
font-size: 32px; /*no*/
line-height: 1.2;
letter-spacing: 0.01333rem;
}
export default {
module: {
loaders: [
{
test: /\.css$/,
loader: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
[
'postcss-pixel-to-remvw',
{
// Options
},
],
],
},
},
},
],
},
],
},
};
const { writeFile, readFileSync } = require('fs');
const postcss = require('postcss');
const pxtoremvw = require('postcss-pixel-to-remvw');
const processedCss = postcss(pxtoremvw()).process(readFileSync('test.css')).css;
writeFile('test.remvw.css', processedCss, err => {
if (err) throw err;
console.log('Rem file written.');
});
default:
{
baseSize: {
rem: 75, // 10rem = 750px
vw: 7.5, // 100vw = 750px
},
unitPrecision: 5,
selectorBlackList: [],
propList: ['*'],
minPixelValue: 0,
exclude: null,
// Single rule does not convert
keepRuleComment: 'no',
// The entire file is not converted
commentOfDisableAll: 'disable-convert',
// The entire file is not converted to rem
commentOfDisableRem: 'disable-convert-rem',
// nThe entire file is not converted to vw
commentOfDisableVW: 'disable-convert-vw',
};
baseSize
{Object} the base size config, default is { rem: 75, vw: 7.5 }
rem
{Number | undefined} the root element font size, means 1rem = [your setting] px; It won't convert to rem while rem
is undefinedvw
{Number | undefined} the base ratio for viewport width, means 1vw = [your setting] px; It won't convert to vw while vw
is undefinedunitPrecision
{Number} the digital accurarcy of converted stylesheetselectorBlackList
{string[]} The selectors list to ignore conversion
propList
{string[]} The properties that can do the conversion.
minPixelValue
{Number} the minimum pixel value to replaceexclude
{String | Regexp | ()=>boolean} the file path to ignore conversion
keepRuleComment
{String} a comment stating that the property will not be convertedcommentOfDisableAll
{String} a comment stating that the whole file will not be convertedcommentOfDisableRem
{String} a comment stating that the whole file will not be converted to rem,but keep convert to vwcommentOfDisableVW
{String} a comment stating that the whole file will not be converted to vw,but keep convert to remThanks to postcss-pxtorem
FAQs
a postcss plugin for converting px to rem and vw
The npm package postcss-pixel-to-remvw receives a total of 9 weekly downloads. As such, postcss-pixel-to-remvw popularity was classified as not popular.
We found that postcss-pixel-to-remvw 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.