Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@dialpad/postcss-responsive-variations
Advanced tools
PostCSS plugin for creating responsive variations from a list of classes
PostCSS plugin for creating responsive variations from a list of classes.
/* Input example */
.foo {
.background-color: red;
}
/* Output example */
.foo {
.background-color: red;
}
@media (max-width: 480px){
.sm\:foo {
.background-color: red;
}
}
@media (max-width: 640px){
.md\:foo {
.background-color: red;
}
}
@media (max-width: 980px){
.lg\:foo {
.background-color: red;
}
}
@media (max-width: 1264px){
.xl\:foo {
.background-color: red;
}
}
Step 1: Install plugin:
npm install --save-dev postcss @dialpad/postcss-responsive-variations
Step 2: Check you project for existed PostCSS config: postcss.config.js
in the project root, "postcss"
section in package.json
or postcss
in bundle config.
If you do not use PostCSS, add it according to official docs and set this plugin in settings.
Step 3: Add the plugin to plugins list:
module.exports = {
plugins: [
+ require('postcss-responsive-variations'),
require('autoprefixer')
]
}
Step 4: Create the responsive breakpoints and the classes you need and pass it to the plugin argument.
+const breakpoints = [
+ { prefix: 'sm\\:', mediaQuery: '(max-width: 480px)' },
+ { prefix: 'md\\:', mediaQuery: '(max-width: 640px)' },
+ { prefix: 'lg\\:', mediaQuery: '(max-width: 980px)' },
+ { prefix: 'xl\\:', mediaQuery: '(max-width: 1264px)' },
+];
+const classes = [
+ '.foo',
+ /\.bar-*/
+];
module.exports = {
plugins: [
+ require('postcss-responsive-variations')({breakpoints, classes}),
require('autoprefixer')
]
}
FAQs
PostCSS plugin for creating responsive variations from a list of classes
The npm package @dialpad/postcss-responsive-variations receives a total of 53 weekly downloads. As such, @dialpad/postcss-responsive-variations popularity was classified as not popular.
We found that @dialpad/postcss-responsive-variations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.