Don't mutate nested rules when generating variants
This commit is contained in:
parent
27a9cd9456
commit
660ea44db2
2 changed files with 42 additions and 1 deletions
|
|
@ -12,7 +12,11 @@ export default function generateVariantFunction(generator) {
|
|||
container: cloned,
|
||||
separator: config.separator,
|
||||
modifySelectors: modifierFunction => {
|
||||
cloned.walkRules(rule => {
|
||||
cloned.each(rule => {
|
||||
if (rule.type !== 'rule') {
|
||||
return
|
||||
}
|
||||
|
||||
rule.selectors = rule.selectors.map(selector => {
|
||||
const className = selectorParser(selectors => {
|
||||
return selectors.first.filter(({ type }) => type === 'class').pop().value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue