-
I always write some of my own CSS rather than sticking purely to utility classes. If I’m defining my own layers, how do I control the order of layers? The approach I’m taking at the moment is leading to duplication. It has output this:
I’d like some Tailwind layers (the utilities layer for example) to be given a higher priority than my custom one, and others, like theme and base, to get a lower priority than my custom layer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Breakout the @layer theme, base, my-custom-layer, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities); |
Beta Was this translation helpful? Give feedback.
-
Related:
Actually, in the earlier sections I said the same thing Wongjn mentioned here earlier. Just follow that. That said, it's still worth considering whether you really need a custom layer at all.
|
Beta Was this translation helpful? Give feedback.
Breakout the
@import "tailwindcss";
statement into its constiuent parts. This allows you to add your custom layer: