babel-plugin-stylis
a babel plugin example
Last updated a year ago by malbernaz .
MIT · Original npm · Tarball · package.json
$ cnpm install babel-plugin-stylis 
SYNC missed versions from official npm registry.

babel-plugin-stylis

babel-plugin-stylis is a babel plugin to precompile a style string into a minified and optimized version. For so it uses the stylis package.

Install

$ npm i babel-plugin-stylis # or yarn add babel-plugin-stylis

Usage:

Add the plugin to your .babelrc:

{
  "plugins": [
    [
      "babel-plugin-stylis",
      {
        /* options */
      }
    ]
  ]
}

From now on the css tagged template expression will be available in your code:

var s = css`
  .some-class {
    display: flex;
  }
`;

transforming your css to a minified and optimized version:

var s = ".some-class{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}";

License

MIT

Current Tags

  • 1.0.0                                ...           latest (a year ago)

1 Versions

  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (11)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |