And you shouldn’t, because there’s always something that is missed or compromised on, and if you expect 100% consistency you will be disappointed 100% of the time.
If you ever get back there worth looking at tailwind. Made the whole thing a lot simpler to me at least when I picked it up. Not trying to ever do anything fancy though
Using Tailwind without understanding CSS is like, instead of cleaning your room, you just sweep all the dirt under the sofa, and hide all the trash in the closet
Tailwind is extremely convenient and extremely encourages people to start bloating up stylesheets and kills consistency if you don't know what you are doing.
.... okay, but why would you write inline styles for everything? Design your stylesheet. Target specific elements. I mean, even if the ONLY thing you EVER do is to attach styles to classes and then apply those classes to elements, that's still several tons better than writing inline styles on everything. And you have a rich language of selectors so you usually can target things by what they are, instead of having to paint CSS classes everywhere.
Tailwind is a small improvement over the wrong way of doing things, making it a slightly easier way to do things wrong.
But I didn't say I would? If you'll notice, my response was not to your comment, and was specifically targeted at the other person saying Tailwind is worse than inline styles, which, really, it is not.
How is loading up a library better than doing what the browser's already capable of? Why do you need to have a two step process to do what the browser natively supports? AT VERY BEST, it is equivalent to inline styles, but with extra effort, a pointless library, and more things that could go wrong. But more importantly, it is only comparable to INLINE styles. Why would you use Tailwind when you can use proper style sheets? Where is the advantage of Tailwind?
Tailwind is basically like writing inline styles, except you get access to states (hover:) and pseudo elements. In that regard it's an upgrade.
However, it's worse in the sense that when you're using inline styles, you know it's wrong and should only be used sparingly. With tailwind, it's the desired behavior.
There's also the issue of duplicate code. It's true that tailwind sends less CSS, since all the classes are only ever defined once. But it's immediately offset by having to include the exact same classes in the HTML. Yes, the duplicate classes will get gzipped into basically nothing, but what about all those one-off special cases that you sometimes need, like h-(--header-height)? Those will stay basically as-is in HTML, and will be generated in CSS as .h-(--header-height) { height: --header-height } (likely with some escaping going on to produce a valid selector).
Add to it the fact that tailwind is pretty much a DSL at this point that's an imperfect mimic of CSS. Seriously, you need to first know the CSS you want to use, then convert it into tailwind's syntax. And that syntax is often more verbose, despite shortening all the property names as much as possible. See all the prefixing you have to do, things like hover:, md: or dark:md:hover:, on every single class you want to apply in that specific combination of modifiers.
IMO tailwind (and tbh a lot of frontend tooling) capitalize on the initial feeling of "productivity" that happens when the project is still new. You can just put out code, or even have ai generate it, and it'll be "good enough" for the MVP. But then you end up with thousands of lines of HTML, each having fifty tailwind classes, and start thinking to yourself that maybe you shouldn't have joked about Java class names being so long you need an ultrawide screen to see them.
Not way way back in the internet explorer era I believe. This were the days, no consistency, lots of little tricks (like console log could sometimes crash IE) and so might polyfill
God, I hated having to account for Internet Explorer's quirks so much. Like sure, things aren't perfect now by any means but I do occasionally have to take a moment to be thankful for no longer having to support that piece of crap.
<link rel="stylesheet" href="..."> actually follows proper HTML/SGML architecture, because <link> was built specifically for external document relationships before CSS even existed.
Netscape broke the pattern when they rushed out Navigator 2.0 and slapped src directly onto <script>. Both <style> and <script> should have stayed purely as container tags for inline code, while external JavaScript should have always been loaded through <link rel="script" href="...">.
The real inconsistency isn't that <style> is missing a src; it's that external JavaScript should have been a <link rel> from day one.
Tbf I didn't test it myself (I'm not sure caniuse is specific enough for link parameters), but when I looked for old stackoverflow answers, it seemed the consensus was that link was not suited for scripts at all. So I expect old browsers to break and new ones to have never tested it properly, especially as script tags became more and more complex over time.
The possible supported tokens are alternate, dns-prefetch, expect, icon, manifest, modulepreload, next, pingback, preconnect, prefetch, preload, search, and stylesheet.
So using <link rel="script" would actually violate the HTML standard. That's... sad.
I guess it's because JavaScript is synchronous (without defer or async ofc), it must be parsed and executed on the spot when constructing the webpage (mainly thanks to document.write?).
While <link> does't affect the document content itself, so it's meant to handle resourses that can be handled later. That's why JavaScript cannot be loaded by <link>, I reckon.
Perhaps this could be solved by allowing <link urgent="true" script="whatever.js.your.boat">? Allow a tag to command the page to load and parse the script on the spot.
(Well, that or account for multipass parsing to load resources on one pass and execute them on the next, but that sounds like a nightmare for dynamically updated sites.)
A user agent SHOULD NOT send a Content-Length header field when the request message does not contain content and the method semantics do not anticipate such data
So I feel a better semantic would would a 204 (No Content) response, which would remove the need for a content-length header altogether.
To establish consistency, you must first convince developers that a standard way is better than their own way.
On top of the standard way needing the ability to fit all the wild and whacky ways that webdevs can organize and run their servers, and be backwards compatible for companies that don't have webdevs anymore and still expect IE7 compatibility so people can reach their website that hasn't been touched in decades.
1.5k
u/Luzzgar Oct 08 '26
If you're looking for consistency, you're going to be looking for long time.
55
u/SuitableDragonfly Oct 08 '26
I briefly did some frontend work once, and the main thing I came out of that experience with is that CSS was designed by Satan.
356
u/SukusMcSwag Oct 08 '26
Your first mistake was assuming that the web is well designed
324
u/lucidbadger Oct 08 '26
Something about when things are supposed to be loaded by the browser
415
u/ApprehensiveGas85 Oct 08 '26 •
<link rel="stylesheet" href="...">actually follows proper HTML/SGML architecture, because<link>was built specifically for external document relationships before CSS even existed.Netscape broke the pattern when they rushed out Navigator 2.0 and slapped
srcdirectly onto<script>. Both<style>and<script>should have stayed purely as container tags for inline code, while external JavaScript should have always been loaded through<link rel="script" href="...">.The real inconsistency isn't that
<style>is missing asrc; it's that external JavaScript should have been a<link rel>from day one.85
u/1nc06n170 Oct 08 '26
Blame Netscape
13
u/MsInput Oct 08 '26
lol this has irked me for decades
24
u/DogmaticParadigm87 Oct 08 '26
Wait till he finds out <link> isn't for links.
8
u/CruxTheologorum Oct 08 '26
you know what thats a good point what the fuck w3c
8
u/MistrFish Oct 08 '26
I remember when HTML5 was such a big deal and I read an entire book on it. as a modern dev it's completely meaningless to me
3
u/traplords8n Oct 08 '26
Consistency is the enemy of the web.
To establish consistency, you must first convince developers that a standard way is better than their own way.
On top of the standard way needing the ability to fit all the wild and whacky ways that webdevs can organize and run their servers, and be backwards compatible for companies that don't have webdevs anymore and still expect IE7 compatibility so people can reach their website that hasn't been touched in decades.
2
u/ExtraWorldliness6916 Oct 10 '26
At one point in html 5, we used to have html imports
1
u/lk_beatrice Oct 13 '26
so glad AI ended ts
1
u/powertrip00 Oct 13 '26
We don't question the ancient tomes
-7
u/james_harushi Oct 08 '26
r/firstweekcoderhumor
0
u/[deleted] Oct 08 '26
[deleted] — view deleted comment