this post was submitted on 02 Aug 2023
0 points (NaN% liked)

Programming

13360 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
top 7 comments
sorted by: hot top controversial new old
[–] r1veRRR@feddit.de 0 points 1 year ago

While I understand the idea behind using CSS "correctly", I have, in my 15 years of professional experience, never ever seen even one project where the hypothetical promises of CSS were actually realized. It ALWAYS ends up with a fuckton of importants, or hunting for ages for the one class fifteen levels of abstraction up that changes your one element, coming up with more and more absurd class names, until they are literally no different from just some random name. Tailwind might seem horrible in a theoretical sense, but in an actually using it sense it's a heaven sent. I want to change the padding on THIS ONE SINGLE ELEMENT, I change it EXACTLY RIGHT THERE where the element is defined, and i can be absolutely sure that I haven't accidentally cascaded someone else's work to death.

#CSS, in practice, is the insane idea of every single element on your website sharing global, mutable state, and thinking that's in anyway smart.

[–] Kissaki@feddit.de 0 points 1 year ago
.btn {
  @apply m-2 p-2 bg-blue text-white
}

lol, they're basically writing a CSS class with CSS rules

Why bother to even use @apply? Just write the damn CSS.

I agree.

[–] autumn@beehaw.org 0 points 1 year ago (1 children)
[–] Kissaki@feddit.de 0 points 1 year ago* (last edited 1 year ago)

But why is CSS so undervalued when it’s a necessary component of most websites and applications? Heydon Pickering writes that it’s partially due to the femininity of CSS: In my experience, men especially earn kudos for their knowledge of JavaScript or Python, but little from CSS skills. CSS, which makes things look ‘pretty’, is considered feminine (don’t tell that to a peacock).

Uh, what? I've never seen or heard that kind of perspective. And I don't agree with it.

Technical teams certainly often focus on the more technical aspects. With requirements and [time] pressure, technical teams often remain within that view scope.

But as soon as you get other people on board technicality loses its importance. What you see is what you discuss and present and has impact.

I would have never thought of putting a gender on one or the other, or on a language.

CSS being a feminine language isn’t a bad thing. Quite the contrary, I’d argue that all programming is feminine as it was pioneered by women (who were then pushed out by men).

This argumentation seems pretty pointlessly far off of the topic at hand. Why do you feel the need to categorize programming - and even all of programming - into a gender? That's completely misguided.

[–] toxicsyntax@feddit.dk 0 points 1 year ago* (last edited 1 year ago) (1 children)

I think the article fails to mention that one of the reasons tools like Tailwind (and methodologies like BEM, etc.) exist in the first place is to facilitate bigger organisation sites.

In my personal experience "plain old CSS" isn't feasible as the number of mainterners on a site goes up. Once there is multiple teams (possibly even across multiple departments) contributing to a site, the cascading part of CSS means that it is more or less unavoidable that some change from one team unintentionally breaks something for another team - and this being visual things means that it is very hard to catch with automated tests.

After having working in a big organisation for a while, most developers will eventually start wishing for something that would make sure that their CSS only applies to their own components. div tags with inline style attributes suddenly starts to look very attractive - which is what eventually led to something like Tailwind.

[–] Kissaki@feddit.de 0 points 1 year ago

Wouldn't it work with adequate scoping of components?

A UI component gets an adequate, scoped, unique class name and CSS.

I imagine tailwind doesn't actually solve parent CSS declarations bleeding into components if they are not explicitly defined/overwritten?

[–] Kissaki@feddit.de 0 points 1 year ago* (last edited 1 year ago)

Websites that use reasonable or good HTML markup with structure, the correct HTML tags, useful ids and classes are great to work with. But regularly you see websites with generated HTML without any useful identifiers or structure. A generated garbled mess of anonymous, generic components and styling CSS classes.

I've worked on content extraction for OpenTermsArchive and write my own injected CSS hacks and browser extensions. Working with good website sources is great. Working with garbled messes is awful.

HTML losing its markup aspect - that you can traverse and select - makes websites inaccessible.


/edit - adding:

The CSS tailwind generates might not be bloated, but repeating the gigantic strings of classes all over your codebase certainly adds to the size of the final HTML output.

The HTML is not just bigger, but bloated and inaccessible. HTML markup with identifiers and classes is readable and understandable. It has structure and labeling. Inlining styling rules bloats it to the point of unreadability. And losing identifiers and classes is a loss of labeling and selectors.