Package Exports
- jss-extend
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jss-extend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
JSS plugin that enables inheritance
This plugin implements a custom extend
style property.

Usage example
import jss from 'jss'
import extend from 'jss-extend'
jss.use(extend())
const redContainer = {
background: 'red'
}
let sheet = jss.createStyleSheet({
container: {
extend: redContainer, // Can be an array of styles
'font-size': '20px'
}
})
/**
* For those who use an ES6 transpiler - you can achieve the same
* by using the language itself.
*/
// ES7
let sheet = jss.createStyleSheet({
container: {
...redContainer,
'font-size': '20px'
}
})
// ES6
let sheet = jss.createStyleSheet({
container: Object.assign({}, redContainer, {
'font-size': '20px'
})
})
console.log(sheet.toString())
.jss-0-0 {
background: red;
font-size: 20px;
}
console.log(sheet.classes)
{ container: 'jss-0-0" }
Run tests
npm i
npm run test
License
MIT