postcss-parse-atrule-events

0.8.252 • Public • Published

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

Package Sidebar

Install

npm i postcss-parse-atrule-events

Weekly Downloads

1

Version

0.8.252

License

MIT

Last publish

Collaborators

  • serkansipahi