JSS plugin that adds units to numeric values
Provide plain numeric values in your JSS style definitions, and the plugin will insert the apposite units. Defaults to px
for sizes, ms
for durations, and %
for transform origins, and these can be customized easily (see Usage Example).
Make sure you read how to use plugins in general.
Setup
// Optionally you can customize default units.const options = 'line-height': 'rem' 'font-size': 'rem' jss
Example
const styles = container: 'line-height': 3 'font-size': 17 'height': 200 'z-index': 1
Compiles to:
Demo
Issues
File a bug against cssinjs/jss prefixed with [jss-default-unit].
Run tests
npm inpm run test
License
MIT