JSS plugin enables string templates
npm install jss-template
Make sure you read how to use
plugins
in general.
This plugin allows you to use string templates to declare CSS rules. It implements a __very naive__ but __very fast (~42000 ops/sec)__ runtime CSS parser, with certain limitations:
- Supports only rule body (no selectors)
- Requires semicolon and new line after the value (except of last line)
- No nested rules support
``js
const styles = {
button:
border-radius: 3px;
background-color: green;
color: red;
margin: 20px 40px;
padding: 10px;
,color: black
'@media print': {
button: opacity: 0
},
'@keyframes id': {
from: ,opacity: 1
to: `
}
}
File a bug against [cssinjs/jss prefixed with \[jss-template\]](https://github.com/cssinjs/jss/issues/new?title=[jss-template]%20).
`bash``
npm i
npm run test
MIT