10 ms·
The secret: use SCSS or LESS to pack the combined effect of "p-3 border-1 shadow-sm rounded-2" into a single class.
by rzzzt 2y ago
The secret: use SCSS or LESS to pack the combined effect of "p-3 border-1 shadow-sm rounded-2" into a single class.
- WorldMaker 2y agoThat just reinvents CSS the long way around. If you are making classes anyway, what do you need the shorthand DSL for the existing, robust DSL for?
- spyke112 2y agoSooooo mixins? You can do that with Bootstrap as well.
- gedy 2y agoI agree, but that approach seems to be uncommon or at least discouraged by the Tailwind creator. I'd actually recommend Tailwind shops use the DaisyUI plugin which gives component classes similar to Bootstrap.
- rzzzt 2y agoIndeed, the reasoning I've read falls close to the last paragraph of your previous comment. Components will consistently apply "atomic styles" everywhere and so are thought to be a replacement for "semantic styling" (sprinkling in some quotes because I don't know the exact terminology).
- gedy 2y agoYeah it's one of those things I just don't agree with them from practical experience. No beef against utility classes in general just not for everything. In fact I really like Bootstrap's which are just enough to help, but are still themeable: https://getbootstrap.com/docs/5.3/utilities/api/ https://getbootstrap.com/docs/5.3/utilities/api/
- floydnoel 2y agoor use DaisyUI or something similar that does it for you