Cleanup leftover layers (#4853)

* update snapshots with correct version

* add test that verifies @layer is removed correctly

* cleanup leftover `@layer` nodes
This commit is contained in:
Robin Malfait 2021-07-01 12:34:11 +02:00 • committed by GitHub
parent fe27356680
commit f4ea2cf77d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 2 deletions

View file

@ -238,5 +238,12 @@ export default function expandTailwindAtRules(context) {
// Clear the cache for the changed files
context.changedContent = []
// Cleanup any leftover @layer atrules
root.walkAtRules('layer', (rule) => {
if (Object.keys(layerNodes).includes(rule.params)) {
rule.remove()
}
})
}
}