Re:Tailwind Is a Leaky Abstraction
by antihero on Wednesday November 30, 2022 @06:27AM
(#33799323)
The other cool thing is that you can code up your design system in the tailwind config and never have to worry about devs not using the correct sizes/colours/etc.
[ Parent
| on HN ]
I recall there being Stylelint rules for linting against hardcoded values. I can't seem to find the link rn though.
You can do exactly the same with pure CSS. This is not a Tailwind advantage.
How much effort does it take to set up, though? I thought the CSS variable system was pretty rudimentary.
> How much effort does it take to set up, though?
Practically none. And any designer is prone to reuse the same spacings from project to project. So you bring the language file with you. Something like this :
:root { --spacing-sm: 1rem; --spacing-md: 2rem; --size-tall: 32px; ... }
And you can do some pretty nice things with these pure CSS tokens. Without any hassle or dependency.