3 ms·
> any classes in the base layer will be sorted first, followed by classes in the components layer, and then finally classes in the utilities layer I guess you
by paulddraper 3y ago
> any classes in the base layer will be sorted first, followed by classes in the components layer, and then finally classes in the utilities layer
I guess you can get away with that because a tool can follow those rules.
But man, I <3 alpha sort.
- pech0rin 3y agoIt follows the order the classes are written in the css so it makes understanding how the css is applied easier. It’s not just an arbitrary ordering
- dumbo-octopus 3y agoThat's how you get very-important layout classes (hidden, flex, etc) put arbitrarily in the middle of purely-visual ones (border, etc.). I've seen this in practice, and it makes grokking exiting code a massive pain. But then I'm so old school I prefer just putting the CSS in the CSS, or even the `style` attribute. (I must say I do appreciate the pseudo-class support in tailwind.)
- paulddraper 3y agoBut then if I'm looking for "xyz" in a list of a dozen classes, I can easily find whether it exists.