jss-increase-specificity
Increases specificity of selectors. Port of postcss-increase-specificity.
use :not(#\20), :not(.\20) and :not(\20) instead of generating unlikely appearing ids…
—twitter.com/subzey/status/829050478721896448
Rationale: \20 is a css escape for U+0020 Space, and neither classname, nor id, nor tagname can contain a space
—twitter.com/subzey/status/829051085885153280
install
npm install --save jss-increase-specificity
Usage
; jss const styles = button: fontSize: 12 '&:hover': background: 'blue' ctaButton: extend: 'button' '&:hover': background: '@media (min-width: 1024px)': button: width: 200 const classes = jss documentbodyinnerHTML = ` Button CTA Button `
Result
Button CTA Button
API
increaseSpecificity(options)
Options:
repeat
Type: Number
Default: 3
How many times should plugin repeat :not(#\20)
.
Disable plugin for a Sheet
jss
License
MIT © Vladimir Starkov