1. 19
  1.  

  2. 7

    My CSS is decidedly not an interface. I don’t write much of my own CSS. I use tailwind utilities as much as I can, and I only write the bare minimum. But whatever’s there is just meant to make the other things I use work with minimal fuss. It’s not an interface I want anyone or any tool to use or maintain.

    I do my best to make my markup accessible to assistive tech. And I make APIs for things I’m really committed to. My CSS is a pile of junk I use to make my final product look OK on browsers. It’s not an interface in any sense of the term that implies a commitment to its stability.

    1. 6

      This is like arguing you should have braille in your kitchen in case a visually impaired person decides to cook there. It could happen and there are people for whom that’s a real usecase, but it’s not normal and there’s no reason to expect everyone to do it preemptively.

      Note that this is totally different from using semantic HTML. Semantic HTML is like having braille on a public elevator: of course you should do it because visually impaired people use elevators all the time, just like everyone else. Semantic CSS is just a solution in search of a problem.

      1. 2

        Semantic HTML is like having braille on a public elevator: of course you should do it because visually impaired people use elevators all the time, just like everyone else. Semantic CSS is just a solution in search of a problem.

        I like the way you formulated that. I’d probably go a bridge farther though: semantic CSS is (a landmine or a footgun) disguised as a solution in search of a problem. CSS is how we adapt semantic markup to various “display” formats. (Scare quotes on display because not all of the formats are visual.) Attaching semantics to it is likely to cause harm. Because as styling needs evolve, CSS will change, and it’s not meant to take anything other than styling into account.

        Use semantic markup where you need to transmit that kind of metadata. Overloading CSS for that will just end badly, in my opinion.

      2. 5

        The author’s premises go something like this:

        1. There’s a bug in a proprietary software application.
        2. The UI happens to have been built with CSS.
        3. The CSS language was not originally designed to build native-like applications (which are bad). It was designed to be an extensible or “malleable” language.

        Then the author concludes that the app’s authors owe them CSS class names as an API service so the author can monkey patch the app themselves. That doesn’t really follow.

        I don’t have much sympathy for this appeal to tradition in general. The CSS language was designed in haste by someone who has been consistently opposed to a web that would lend itself to design tools. He feared that the web might turn into something slick and commercial if the power to style it wasn’t taken out of designers’ hands and given to developers. Whereas PostScript got Adobe Illustrator in about five years, there are design choices in the CSS language that have left us without a comparable visual CSS editor for 25 years and counting:

        • Rules and class names are always (with only a couple of rare exceptions) evaluated in a global scope.
        • Conflict resolution between rules—within and across files—is based on the specificity of the rules’ selectors.
        • Rules are often (but not always) inherited automatically from parent elements.

        There are other quirks in the language that can and have been ironed out over the years. It’s these design choices in particular are fundamental to the language and not easily undone. And we still got a commercial web. It just isn’t very slick. So, whenever you run across “robot friendly” class names, don’t assume incompetence or malice. Most of us are just trying to implement good design in a design-hostile environment.

        1. 1

          So, other than him building CSS in order to try to help HTML stay relevant, the only thing I see in the article that he was opposed to was CSS-Flow (which looks interesting, but also seems like something I’d typically to be accomplished with JS).

          Granted, CSS as a design definitely has issues, especially those of global scope, but I don’t see those as artifacts of malice, but rather being underbaked on the first draft, and not being fixed due to the compatibility curse that the web falls under?