Détail du package

jss-px

jsstyles89MIT1.0.0

JSS plugin that adds default px unit to numeric values where needed

jss, plugin, px

readme

JSS logo

JSS plugin that adds default px unit to numeric values where needed

This plugin lets you omit the px unit from values of style properties.

Demo - JSS

Gitter

Usage example

import jss from 'jss'
import px from 'jss-px'

jss.use(px())

let sheet = jss.createStyleSheet({
  container: {
    'font-size': 20,
    'z-index': 1,
    'line-height': 1.2
  }
})
console.log(sheet.toString())
.jss-0-0 {
  font-size: 20px;
  z-index: 1;
  line-height: 1.2;
}
console.log(sheet.classes)
{ container: "jss-0-0" }

Run tests

npm i
npm run test

License

MIT

changelog

1.0.0 / 2015-10-19

  • support jss 3.0
  • now plugin needs to be called like a middleware

0.2.0 / 2015-09-21

  • migrate to es6
  • move examples to jss-examples repository
  • simplify packaging

0.1.2 / 2015-02-10

  • add "flex" to the black list

0.1.1 / 2015-01-31

  • update to jss 1.0

0.1.0 / 2015-01-05

  • first release