23 ms·
I don't use tailwind but surely it has ways to standardize this kind of stuff?
by sfn42 20d ago
I don't use tailwind but surely it has ways to standardize this kind of stuff?
- kaoD 20d agoTailwind's philosophy is that you must not use CSS facilities at all and instead all their utility classes should be inlined into the HTML soup. This leaves framework components as the only abstraction boundary, but that means if you're writing plain HTML without a framework there's literally no way to standardize your design system. That and the huge soup of classes in DOM is (part of why) I don't like Tailwind... but that ship sailed a long time ago.
- scoopertrooper 20d agoYou can define css classes that combine multiple tailwind classes https://tailwindcss.com/docs/functions-and-directives#apply-directive https://tailwindcss.com/docs/functions-and-directives#apply-...
- kaoD 20d agoYou can, but it goes against Tailwind's philosophy. It used to be explicitly discouraged here[0] (see this 2022 GH comment[1]), but now they just don't mention it. [0] https://tailwindcss.com/docs/styling-with-utility-classes#managing-duplication https://tailwindcss.com/docs/styling-with-utility-classes#ma... [1] https://github.com/tailwindlabs/tailwindcss/discussions/7651#discussioncomment-2250993 https://github.com/tailwindlabs/tailwindcss/discussions/7651...