postcss-parse-atrule-events
v0.8.252
Published
postcss plugin for parsing atrule events
Downloads
13
Maintainers
Readme
postcss-parse-atrule-events
Postcss plugin for auto generating code
Installation
$ npm install postcss-parse-atrule-events --save
Usage
Via Node API
let result = require('postcss-parse-atrule-events').parse('code');
Example
Input:
@on load {
@fetch my/async/styles1.css;
@fetch my/async/styles1.css;
}
.my-critical-path-selector {
width: 100px;
height: 100px;
}
Output:
let output = [
{
attachOn: "load",
imports: [
"my/async/styles1.css",
"my/async/styles1.css"
],
styles: "",
type: "on",
},
{
attachOn: "immediately",
imports: [],
styles: ".my-critical-path-selector { width: 100px; height: 100px; }",
type: "default",
},
];
Tests
git clone https://github.com/SerkanSipahi/app-decorators.git
cd app-decorators/packages/postcss-parse-atrule-events
npm run test