postcss-at-debug
v1.0.0
Published
Keep nodes inside the @debug at-rule in debug mode and remove them in release mode
Downloads
7
Readme
PostCSS At-Debug
PostCSS plugin to keep nodes inside the @debug at-rule in debug mode and remove them in release mode.
Install
npm install postcss-at-debug --save-dev
Usage
Debug mode
var postcss = require('postcss');
var debug = require('postcss-at-debug');
var fs = require('fs');
var mycss = fs.readFileSync('input.css', 'utf8');
var output = postcss([
debug({
debug: true
})
])
.process(mycss)
.css;
console.log(output);
Input:
@debug {
.body {
color: red;
}
#root {
background-color: blue;
}
}
h1 {
font-style: italic;
}
Output:
#root {
background-color: blue;
}
.body {
color: red;
}
h1 {
font-style: italic;
}
Release mode
// ...
var output = postcss([
debug({
debug: false
})
])
.process(mycss)
.css;
console.log(output);
Input:
@debug {
.body {
color: red;
}
#root {
background-color: blue;
}
}
h1 {
font-style: italic;
}
Output:
h1 {
font-style: italic;
}
Options
debug
: boolean - flag for debug mode- Default:
'true'
- Default:
Testing
npm test