413
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]
top 50 comments
sorted by: hot top new old
[-] [email protected] 3 points 14 hours ago

I wonder if any colorblind people completely didn't understand this meme

[-] [email protected] 24 points 1 day ago

Which CSS framework is it that puts this shit everywhere?

That one can die in a fire.

[-] [email protected] 19 points 23 hours ago

fun fact: This isn’t any one specific CSS framework's doing but rather part of how JS UI libraries handle scoped CSS. When you have for example two components that have similar CSS, like one component sets button to color green, another component sets button to blue, then the compiler does this kinda thing because "real" CSS doesn’t support scoping.

So in the above example you'd get button class abcd and button class bcde.

[-] [email protected] 3 points 23 hours ago* (last edited 22 hours ago)

How *some JS UI libraries handle scoped CSS. Vue for example uses data- attributes instead.

[-] [email protected] 9 points 23 hours ago

I'm honestly not sure, but I'm fairly certain it's intentional obfuscation done for the production build. Why they think it's so important to hide class names, I'll never know.

[-] [email protected] 4 points 19 hours ago

It is not intentional. The tooling needs to generate a short unique id to prevent css name clashing.

During development 2 developers can write the same css class name in two seperate places:

  • developer A: .container { padding: 8px } at dashboard
  • developer B: .container { padding: 32px } at sidebar

Without this tooling developer need to find ways to prevent name clashing:

  • .dashboard__container
  • .sidebar__container

and they need to do this for every class name.

with this tool, developer don't have to worry about this ever, continue using .container and it get generated into:

  • .aP2be7
  • .7aFrJp
[-] [email protected] 6 points 23 hours ago

To fight ad blockers

[-] [email protected] 16 points 1 day ago

I've used raw CSS for the last 2 years at work and it's not like it's magically better or my productivity is higher or that it is simpler to read and understand.

Use the tool that works for you, tailwind is fine.

[-] [email protected] 51 points 1 day ago

Tailwind is like going back to in-line styles. If you add font tags you are back in the 2000’s

[-] [email protected] 4 points 1 day ago

except we generally use higher level abstractions now, like component based frameworks. If you're writing raw html with tailwind and no library you're doing it wrong and css is a better fit.

well written straight css ends up building it's own tree of components. if you're using react too you're either only selecting a single component (inline styles but have to open two files) or writing good css (duplicating the component hierarchy in css).

tailwind is just the former but better since it encourages using a projectwide set of specific sizes/colors/breakpoints and small scope, the two actual problems with inline styles after organization and resuse, which react etc solves.

[-] [email protected] 6 points 1 day ago

I cannot tell if you're saying tailwind is taking away from useful abstractions or adding to them. I think it's taking away from them. A whole bunch of class names in the page is opposite to what we were taught and there was a good reason for the lesson: content and presentation should be defined separately. This lends flexibility, readability and accessibility. Tailwind doesn't help with anything but preventing a breakage in another component/page. To me the reason to value this trade off is that you don't want devs to "have to care about css" which is a bad sign to begin with. It says "we think the way the web is built is bullshit, so let's just try to work around that with the latest attempt to make it better". The web is not bullshit. CSS is beautiful. Embrace the challenge. (Sorry I'm only halfway directing this rant at you)

[-] [email protected] 3 points 22 hours ago

I'm saying we weren't taught when react was the way people wrote sites. if I was writing a site with pure html, css is great, especially modern css.

but if I'm already using react and their abstractions, opinions on that part aside, I'd personally rather lean on the react component as the unit of reuse. tailwind removes the abstraction that you don't need, since many people in react tend towards one scoped css file per component with classes for each element anyway

at this point I'd be more inclined to say for many sites the api and data fetching things are the content and html+css is presentation. csszengarden is cool but I haven't seen the html/css split help an end user, or really even me as a developer.

[-] [email protected] 2 points 22 hours ago* (last edited 22 hours ago)

tailwind removes the abstraction that you don’t need, since many people in react tend towards one scoped css file per component with classes for each element anyway

What abstraction does it remove? In my view, it just adds slightly different abstractions. Instead of knowing an element has a clean block of rules with set meanings, you get a long (potentially grossly formatted/ordered) string of class names that mean the same thing as the CSS properties for the most part, but you've gotta learn a new set of aliases for them. If I am working on someone else's component, one of these scenarios is way easier for me than the other. Even when I worked with TW for a while, I never could really remember a lot of those class names.

csszengarden is cool but I haven’t seen the html/css split help an end user, or really even me as a developer.

You may have never refactored or reskinned a site. I have several times. The hardest projects like that were when content and presentation were tightly coupled. Those felt like pulling teeth to get done. important! every time a dev buried a style tag somewhere deep in some (for all intents and purposes) unchangeable Java code... shudder When they were loosely coupled, it was fun and went much easier.

edit: respect for knowing csszengarden. That site honestly was the first time I learned this principal and saw it applied. I've themed several websites over the years so I've used the concept myself.

load more comments (4 replies)
[-] [email protected] 24 points 1 day ago

Ngl I love tailwind, I've been through so many different css paradigms

  • separate css files: why did we ever do this, if you've ever used kendo's css stuff you'll understand how unfathomable hundreds of thousands of lines of css with complex rules is. Identifying all the things that affect a single component is the work of dozens of minutes at minimum, sometimes hours, you have to understand every nook and cranny of the css spec.
  • inline styles: fine, but verbose and requires object spreading, harder to compose, theming is tough and requires discipline to be consistent in your theme conventions, almost impossible to also theme imported library components
  • module.css with imported classes: my go to outside of tailwind
  • scss: I actually really like scss but it exacerbates the complexity and mystery of css, great for small projects but terrible as projects bloat
  • bootstrap: basically just worse tailwind, providing only components and colors

That's all I can think of right now, but tailwind is my preferred way to style a new project, I love how easy theming and style consistency is

[-] [email protected] 9 points 1 day ago

Honestly, I'm still very much in the "classes define what a tag represents, CSS defines how it looks" camp. While the old semantic web was never truly feasible, assigning semantic meaning to a page's structure very much is. A well-designed layout won't create too much trouble and allows for fairly easy consistency without constant repetition.

Inline styles are essentially tag soup. They work like a print designer thinks: This element has a margin on the right. Why does it have that margin? Who cares, I just want a margin here. That's acceptable if all you build are one-off pages but requires manual bookkeeping for sitewide consistency. It also bloats pages and while I'm aware that modern web design assumes unmetered connections with infinite bandwidth and mobile devices with infinitely big batteries, I'm oldschool enough to consider it rude to waste the user's resources like that. I also consider it hard to maintain so I'd only use it for throwaway pages that never need to be maintained.

CSS frameworks are like inline styles but with the styles moved to classes and with some default styling provided. They're not comically bad like inline styles but still not great. A class like gap-2 still carries no structural meaning, still doesn't create a reusable component, and barely saves any bandwidth over inline CSS since it's usually accompanied by several other classes. At least some frameworks can strip out unused framework code to help with the latter.

I don't use SCSS much (most of its best functionality being covered by vanilla CSS these days) but it might actually be useful to bridge the gap between semantically useful CSS classes and prefabricated framework styles: Just fill your semantic classes entirely with @include statements. And even SCSS won't be needed once native mixins are finished and reach mainstream adoption.

Note: All of this assumes static pages. JS-driven animations will usually need inline styles, of course.

[-] [email protected] 9 points 1 day ago* (last edited 1 day ago)

I've never quite understood how adding all these HTML classes to a page is supposed to be clean. Just do a decent job of organizing your code and it's honestly not that hard to keep from breaking styles unexpectedly. This is the part you tell me "well that only works for small projects". Not really, it works when styles are managed carefully. I've worked on fairly large sites with what modern standards would call "bad" css practices and it was fine, we just had an understanding that some devs were frontend (I was lead for a couple years at this particular company I'm thinking of) and some were backend. The backend people botched styles every time so we forbade them eventually. I think that contextless type of "help" is where people get the idea that you have to have a css setup that prevents people from breaking anything unexpectedly. CSS just gets no respect. You wouldn't let a frontend guy go changing your core backend code so why is the reverse ok?

I like css modules too but I totally disagree that css is irreparably broken and needs some system that discourages the cascade of styles in all cases.

load more comments (9 replies)
[-] [email protected] 32 points 1 day ago

Genuine question : what's wrong with modern vanilla CSS3 ?

Maybe it's because I've used css2 I don't see the point of css frameworks.

[-] [email protected] 31 points 1 day ago

I was very much against frameworks initially: tailwind, bootstrap etc. However, when I started really building sites & apps using components, I found tailwind made my life a lot easier, so I could easily see and change styling while writing code/html, and it would only affect that component.

Beforehand, I was trying to come up with names for CSS classes all the time, and then I'd change one thing, and fuck up styling on a diff page.

[-] [email protected] 16 points 1 day ago

Honestly love tailwind. Once you get used to all the names/abbreviations and how they work with sizes and states etc. it's much easier to see what's happening when eyeballing code.

Makes reviewing and bug fixing easier too.

I get that early on it feels annoying. I recall disliking it the first time I learnt it, but then when I went back to regular css and classes I really missed it.

[-] [email protected] 2 points 20 hours ago

Yep, a component is a good abstraction level, no point in making life difficult by creating and coming up with names for smaller parts.

[-] [email protected] 3 points 1 day ago

Now it is remembering tags for property instead.

[-] [email protected] 2 points 20 hours ago

Any passable editor nowadays does the heavy lifting for you, you can usually even write the CSS tag you want and it'll show you the options.

[-] [email protected] 2 points 22 hours ago

Except that you learn the class names once and re-use them across all your projects, whereas CSS classes are different for every single project.

[-] [email protected] 14 points 1 day ago

It helps to avoid the specificity problem. You don’t have to manage a complicated class system, you just set styles directly on the elements. Yes this is pretty much what everyone agreed in the past was the worst thing to do but that was before things like CSS variables existed (which Tailwind uses excessively) that lets you control details like color and fonts from a single point. So you don’t have to go through every component to change the brand color.

At work we don’t use Tailwind often but in our React apps we mostly use Theme-UI which lets us write regular CSS on each element in a nice JSON format instead of the class name hell that is Tailwind. This is my preferred way.

[-] [email protected] 7 points 1 day ago

This is very informative. I avoided Tailwind for the reason you mentioned, but look closer now that I know the difference.

[-] [email protected] 3 points 1 day ago

I think it's especially great for smaller apps/sites or prototyping. Setup is quick if you're already comfortable with CLI tools and configs. Or if you just want to get started immediately with no setup, just add a script into your site and when it needs to go into production later you can still do the setup process for a robust build.

load more comments (2 replies)
[-] [email protected] 1 points 18 hours ago* (last edited 18 hours ago)

Don’t know about tailwind but I used styled-components and not going back to vanilla css. CSS seems to be designed to be used with HTML, which did make sense back when it was created. Modern web is 99% JS and components composition which does not work well with Vanilla CSS in terms of class name uniqueness, specificity. Also it easy to dumb shit with CSS, like, I worked in the project where we had a lot of legacy global CSS. We had like dozen CSS styles which were adding margin to , and so on. I mean no classes, just globally. I’ve been forced to add ‘all: unset’ to basically all my new components just to avoid changing global styles and breaking something else. Do not recommend.

[-] [email protected] 1 points 9 hours ago

I tend to build stuff with html css and php only ( all vanilla) and avoid non trivial js like the plague. I can see your point but for me replacing HTML with js is just wastefull, you leave performance and built in accessibility on the table for a slightly more convenient experience that don't work for me.

load more comments (3 replies)
[-] [email protected] 4 points 22 hours ago

Tailwind is sooo great, made me extremely productive when scaffolding layouts and managing my palettes.

I really love it :)

[-] [email protected] 6 points 1 day ago

In my personal projects, I don’t use anything. I wrote a set of utilities and functions in SCSS years ago that let me easily create reusable variables and classes that already do what TW does, but with less bloat and overhead. I get project-specific spacing, colors, font classes, everything.

I also highly recommend picking up Andy Bell’s Complete CSS course.

[-] [email protected] 7 points 1 day ago* (last edited 1 day ago)

As one who creates usercss to fit pages to my needs, Tailwind is second worst.

[-] [email protected] 7 points 1 day ago

Tailwind is for people that don't know how to use CSS properly. There, I said it.

[-] [email protected] 6 points 1 day ago

That's a common misconception by people who never used it. The truth is you need to know CSS to use Tailwind. Just because it simplifies styling doesn't mean it simplifies the underlying technology.

load more comments (2 replies)
[-] [email protected] 2 points 1 day ago* (last edited 1 day ago)

It shocks me to see how many programmers think such framework decisions are one-size-fits-all and jump to conclusion that such framework adoption decisions are is due to lack of skillset and experience.

There are many factors at play. You have time to build and maintain your own utility framework, please go ahead.

Two years ago, I led a team which developed a web app that generated 600 million impressions per year. We used Tailwind because we were a small team and I'd rather have my developers work on high value tasks and not maintain a style framework.

If you are an aspiring developer, know this: There are always trade-offs. Not writing pure CSS does not make you a bad developer. Not knowing system design does.

load more comments (2 replies)
[-] [email protected] 2 points 21 hours ago

They said that You either hate or love tailwind, and when I first used tailwind I assumed it was just a joke, 'why would they hate this? It's simple to use, remember, build, and it even removes unnecessary CSS that I forget to do...'

Apparently it isn't as simple as that.

[-] [email protected] 2 points 19 hours ago

I guess some people write code, and some people also read and maintain it.

load more comments
view more: next ›
this post was submitted on 30 Jun 2025
413 points (97.9% liked)

Programmer Humor

24648 readers
626 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS