Re:Why Tailwind CSS Won
by chipgap98 on Wednesday August 16, 2023 @06:08AM
(#37144921)
Tailwind is also great for this. You create components with Tailwind that make this trivial
[ Parent
| on HN ]
Re:Why Tailwind CSS Won
by fjfuvucucuc on Wednesday August 16, 2023 @06:30AM
(#37145053)
"trivial"?
So I still have to componentize my presentation layers to do tailwind "correctly", but instead of writing CSS in readable multiline chunks in a language every developer already knows, I need to use this cryptic one liner in any order that literally nobody can read?
What in the hell is wrong with this industry? Sometimes clever ideas aren't all that clever. Sometimes they're just dumb.
Re:Why Tailwind CSS Won
by wildrhythms on Wednesday August 16, 2023 @06:40AM
(#37145120)
This might surprise you but most industry web development today is using components powered by a framework, and Tailwind fits in perfectly to the close coupling of styles to components.
But in components with scoped styling, you're better off just using css directly. Create a class that has all the styles you want, then use it in the HTML - nicely and cleanly separates css and HTML code.
Why do you want to separate the CSS and HTML? They’re both style info, especially in component design.
Re:Why Tailwind CSS Won
by fjfuvucucuc on Wednesday August 16, 2023 @09:42AM
(#37146855)
Because they're not both style info? Html is a markup language, it applies semantic structure to your content, CSS styles html.
Classes are a tool for selecting markup to style. Sure, you can create a class for every single CSS rule you write, but just because you can doesn't mean you should.
Re:Why Tailwind CSS Won
by Sander_Marechal on Wednesday August 16, 2023 @06:17AM
(#37144975)
Then you're just back at regular CSS with extra steps