JSS plugin that enables inheritance
This plugin implements a custom extend
style property.
Demo -
JSS
![Gitter](https://badges.gitter.im/Join Chat.svg)
Usage example
import jss from 'jss'
import extend from 'jss-extend'
jss.use(extend)
const redContainer = {
background: 'red'
}
const styleSheet = jss.createStyleSheet({
container: {
extend: redContainer,
'font-size': '20px'
}
})
const styleSheet = jss.createStyleSheet({
container: {
...redContainer,
'font-size': '20px'
}
})
const styleSheet = jss.createStyleSheet({
container: Object.assign({}, redContainer, {
'font-size': '20px'
})
})
import xtend from 'xtend'
const styleSheet = jss.createStyleSheet({
container: xtend(redContainer, {
'font-size': '20px'
})
})
console.log(styleSheet.toString())
.jss-0-0 {
background: red;
font-size: 20px;
}
console.log(styleSheet.classes)
{ container: "jss-0-0" }
Run tests
npm i
npm run test
License
MIT