Ensure all selectors in a rule receive important scope

This commit is contained in:
Adam Wathan 2019-08-06 08:14:16 -04:00
parent 19c74b106a
commit 763ee71033
2 changed files with 30 additions and 4 deletions

View file

@ -59,7 +59,9 @@ export default function(plugins, config) {
if (config.important === true) {
rule.walkDecls(decl => (decl.important = true))
} else if (typeof config.important === 'string') {
rule.selector = increaseSpecificity(config.important, rule.selector)
rule.selectors = rule.selectors.map(selector => {
return increaseSpecificity(config.important, selector)
})
}
}
})