0.0.2 • Published 2 years ago
style-to-string v0.0.2
style-to-string
This plugin transforms StyleObject
to css
string.
Example
In
import style from "style-to-string";
const css = style({ fontSize: 95 });
Out
const css = "font-size: 95px;";
In
import style from "style-to-string";
const value = "95px";
const css = style({ fontSize: value });
Out
const value = "95px";
const css = `font-size: ${value};`;
Installation
npm install --save-dev style-to-string
Usage
// .babelrc
{
"plugins": ["style-to-string/babel"]
}