babel-plugin-stylis
v1.0.0
Published
a babel plugin example
Downloads
2
Readme
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}";