4 ms·
Based on the comments by other folks here, looks like lot of folks are using Tailwind incorrectly and then blame it for not being the right tool. Tailwind clas
by rhuru 3y ago
Based on the comments by other folks here, looks like lot of folks are using Tailwind incorrectly and then blame it for not being the right tool.
Tailwind classes might be verbose but you are not supposed to use them directly in the markup. Always create wrapper classes that are specific to your design and simply apply the utility classes in them.
In short make your own Bootstrap like framework using Tailwind's primitives. Tailwind has made this trivially simple.
- aleksiy123 3y agoThis is specifically what they tell you not to do. https://tailwindcss.com/docs/reusing-styles https://tailwindcss.com/docs/reusing-styles Their advice is to use templating (components, partials, loops) to abstract and I agree. It ends up working a lot better than abstracting your CSS.
- rhuru 3y agoI am sorry I should have written it better. This is how I abstract away from tailwinds utility litter. https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply https://tailwindcss.com/docs/reusing-styles#extracting-class...
- aleksiy123 3y agoFurther down in the link they do talk about not doing this for everything. Only for small things when templates are too much. "Whatever you do, don’t use @apply just to make things look “cleaner”"
- rhuru 3y agoIt is in general good CSS advice not just specific to apply.
- wishinghand 3y agoThis is just CSS classes with more steps.