diff --git a/src/jit/lib/expandTailwindAtRules.js b/src/jit/lib/expandTailwindAtRules.js index c7db3a1e6ee5..3473866d9616 100644 --- a/src/jit/lib/expandTailwindAtRules.js +++ b/src/jit/lib/expandTailwindAtRules.js @@ -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() + } + }) } }