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.
postcss-conditionals
Advanced tools
PostCSS plugin that enables @if
statements in your CSS.
npm install postcss-conditionals
var fs = require('fs');
var postcss = require('postcss');
var conditionals = require('postcss-conditionals');
var css = fs.readFileSync('input.css', 'utf8');
var output = postcss()
.use(conditionals)
.process(css)
.css;
Using this input.css
:
.foo {
@if 3 < 5 {
background: green;
}
@else {
background: blue;
}
}
you will get:
.foo {
background: green;
}
Also works well with postcss-simple-vars:
$type: monster;
p {
@if $type == ocean {
color: blue;
} @else if $type == matador {
color: red;
} @else if $type == monster {
color: green;
} @else {
color: black;
}
}
and with postcss-for:
@for $i from 1 to 3 {
.b-$i {
width: $i px;
@if $i == 2 {
color: green;
}
}
}
npm install
parser.jison
file has been changed, regenerate parser.js
by running npm run gen-parser
2.1.0 - 2016-12-21
FAQs
PostCSS plugin that enables @if statements in your CSS
We found that postcss-conditionals 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
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.