npm.io
0.8.252 • Published 8 years ago

postcss-parse-atrule-events

Licence
MIT
Version
0.8.252
Deps
12
Vulns
6
Weekly
0
Stars
18

postcss-parse-atrule-events

Postcss plugin for auto generating code

Dependency Status devDependency Status

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

Keywords