3 ms·
Once you learn how to read it, it's actually pretty clear. This element has a small amount of x and y padding that is suitable for (for example) keeping text a
by d1sxeyes 9mo ago
Once you learn how to read it, it's actually pretty clear.
This element has a small amount of x and y padding that is suitable for (for example) keeping text away from the edge of the container. The text is white. The corners of this are rounded.
The background is the default intensity 'sky' colour, which darkens slightly on hover and darkens further when it's active.
You can take this from 77 characters to 189 like this:
.button {
background-color: #0ea5e9;
color: white;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
}
.button:hover {
background-color: #0284c7;
}
.button:active {
background-color: #0369a1;
}
Tailwind simplifies consistency, and frankly is pretty readable. It's not like <button type="button" class="button">Button</button> is exactly the pinnacle of human clarity and simplicity in the first place.
Of course there are other ways to do it, but this faux outrage demonstrates not that this is some 'fresh fucking hell' or some 'crack induced nightmare', but rather that you simply don't get it.
- stephenr 9mo agoI didn't say I can't read it. I asked who thought it was a good fucking idea. I guess you've answered that implicitly. Embedding every style directly into the style attribute is also readable, and as a side benefit it doesn't need a build step just to make your styles actually work. I can now see exactly why OP made this post. If a client told me they don't want to use something akin to bootstrap or any other sane css library, and that instead I will need to ensure that every element has every manner of css states expressed as a faux class, I wouldn't even stop to make a coffee before telling them how far they can jump. This sounds perfect for front end “developers" who struggle even with css, and want any reason possible to pad out their billable/working hours doing nothing productive. Oh what's that, you want to change the style of standard button everywhere in the codebase? No of course we can't just update a single css file you silly goose. I feel like half the bad problems in web development are because JavaScript developers saw that j2ee guys had ant and whatnot, and said "hey what if we started inventing reasons to have a build step"? > button class="button" The thing is, that is more readable for a sane code base. If I can glance and know it's using the correct standard button class, it means I don't need to memorise the fucking pixel sizes and states of button paddings. I get it alright. It's a solution looking for a problem that doesn't exist, and instead found a crowd of "developers" looking for anything shiny to pad their resume and keep themselves looking busy.
- d1sxeyes 9mo agoClearly you’ve made your mind up so I won’t push harder, except one point: > Oh what's that, you want to change the style of standard button everywhere in the codebase? Tailwind excels when you are using component based frameworks. This change should be at least as simple as updating main.css, except it’s in Button.tsx
- stephenr 9mo agoWhy am I not surprised this rube Goldberg style machine seems like a rational thing to people who write xml to generate JavaScript to generate html.
- anon373839 9mo agoI think these debates ultimately come down to what you’re making with these tools: is it documents or application interfaces? If it’s documents, then plain HTML, CSS and a touch of JS sprinkles on top works very well, as they were designed for this. If you’re making software, though, at some point you’re going to need some additional tooling to make it feasible.
- stephenr 9mo ago> at some point you’re going to need some additional tooling to make it feasible. I mean sure, most people will pick some kind of abstraction over parsing and constructing raw HTTP messages. But it boggles the mind that apparently a large chunk of "developers" cannot see the insanity in writing XML to generate JavaScript which generates HTML and CSS because they want to write `<Button variant="primary">Save</Button>` rather than... `<button class="primary">Save</button>`. Like I said earlier: so much of the folly in the NodeJS community looks like bizarre adoration of early-2000s J2EE stack. You have a language that requires no AOT.. ah better invent increasingly convoluted and ever-changing build processes for it. You're writing output that's essentially just a string to be sent over the wire... ah better create a wrapper for the wrapper that creates the service which renders the string. But sure. That is totally a rational approach to development, and the nodejs community has never shown itself to be prone to chasing shiny useless things or cargo culting. I must just be overreacting.
- fastasucan 9mo agoWhy would you want all that into the html, instrad of defining it in css?
- d1sxeyes 9mo agoWhy would you want to have to maintain a separate file instead of keeping it all in the same place? Preference I guess. I’m not bashing anyone who prefers writing CSS that way. But there are a lot of people who think it’s very important to share that they don’t like how Tailwind looks. It’s an argument that’s been pretty roundly responded to here: https://tailwindcss.com/docs/styling-with-utility-classes https://tailwindcss.com/docs/styling-with-utility-classes
- stephenr 9mo ago> Why would you want to have to maintain a separate file instead of keeping it all in the same place? The year 2001 called and is demanding royalties for copyright infringement on "How to write your first dynamic page in PHP - just one file needed".
- d1sxeyes 9mo agoThey also want their “year X called” joke back.