diff --git a/lib/processor.js b/lib/processor.js index ee2608119..1fc531f4b 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -458,12 +458,12 @@ class Processor { * Check for grid/flexbox options. */ disabledDecl(node, result) { - if (this.gridStatus(node, result) === false && node.type === 'decl') { + if (node.type === 'decl' && this.gridStatus(node, result) === false) { if (node.prop.includes('grid') || node.prop === 'justify-items') { return true } } - if (this.prefixes.options.flexbox === false && node.type === 'decl') { + if (node.type === 'decl' && this.prefixes.options.flexbox === false) { let other = ['order', 'justify-content', 'align-items', 'align-content'] if (node.prop.includes('flex') || other.includes(node.prop)) { return true @@ -641,15 +641,16 @@ class Processor { }) // Selectors - for (let checker of this.prefixes.remove.selectors) { - css.walkRules((rule, i) => { + css.walkRules((rule, i) => { + if (this.disabled(rule, result)) return + + for (let checker of this.prefixes.remove.selectors) { if (checker.check(rule)) { - if (!this.disabled(rule, result)) { - rule.parent.removeChild(i) - } + rule.parent.removeChild(i) + return } - }) - } + } + }) return css.walkDecls((decl, i) => { if (this.disabled(decl, result)) return