This PR improves the missing layers codemod where everything after the
last Tailwind directive can stay as-is without wrapping it in a `@layer`
directive.
The `@layer` at-rules are only important for CSS that exists between
Tailwind directives.
E.g.:
```css
@tailwind base;
html {}
@tailwind components;
.btn {}
@tailwind utilities;
.foo {}
.bar {}
```
Was transformed into:
```css
@import "tailwindcss";
@layer base {
html {}
}
@layer components {
.btn {}
}
@layer utilities {
.foo {}
.bar {}
}
```
But the last `@layer utilities` is already in the correct spot, so we
can simplify this to just this instead:
```css
@import "tailwindcss";
@layer base {
html {}
}
@layer components {
.btn {}
}
.foo {}
.bar {}
```
|
||
|---|---|---|
| .. | ||
| format-nodes.test.ts | ||
| format-nodes.ts | ||
| migrate-at-apply.test.ts | ||
| migrate-at-apply.ts | ||
| migrate-at-layer-utilities.test.ts | ||
| migrate-at-layer-utilities.ts | ||
| migrate-missing-layers.test.ts | ||
| migrate-missing-layers.ts | ||
| migrate-tailwind-directives.test.ts | ||
| migrate-tailwind-directives.ts | ||