3 ms·
> Being able to think "Hmmm, I want a rounded button, with a border and a blue background" I rarely think this. It's usually “I want a button that looks like a
by xigoi 3y ago
> Being able to think "Hmmm, I want a rounded button, with a border and a blue background"
I rarely think this. It's usually “I want a button that looks like all other buttons on my site”. Vanilla CSS is great for that.
- chipgap98 3y agoTailwind is also great for this. You create components with Tailwind that make this trivial
- Sander_Marechal 3y agoThen you're just back at regular CSS with extra steps
- fjfuvucucuc 3y ago"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.
- wildrhythms 3y agoThis 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.
- Incipient 3y agoBut 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.
- zztop44 3y agoWhy do you want to separate the CSS and HTML? They’re both style info, especially in component design.
- fjfuvucucuc 3y agoBecause 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.
- jacobr 3y agoYes, the biggest drawback of Tailwind is React. Or specifically, relying on components as the mechanism for style composition.
- deleted 3y ago[deleted]
- LtdJorge 3y agoI assume OP means that for the fist button of the site, as in creating the site from 0.
- xigoi 3y agoIn that case, you just write button { /* your styles here */ } to set a precedent for all your future buttons.
- troupo 3y agoIn that case you end up with fifteen different variations of that button, class names like "button-cta__hero__overlay" and a smattering of !importants to defeat the cascade you can't chase down
- xigoi 3y agoI've never ended up with something like this.
- withinboredom 3y agoWork in bigger teams with bespoke css. It will happen ... eventually ... without fail.
- peferron 3y agoCSS classes are great for that until you need to reuse HTML and/or JS, at which point you're back to square one. People are moving to components because they solve these 3 things at once.