Idiomdrottning’s homepage

Re: I used to think CSS was good

ew0k writes:

We now make stylesheets so complicated that we need to write them with a framework that transpiles it down to CSS before shipping? The purpose of stylesheets is to apply consistent styling across semantically distinct content.

I’m not onboard with that perspective. CSS is the appropriate place for presentation complexity.

He goes on:

JavaScript is not bad. It has its purpose, which for example stylesheets are for? No!

JavaScript mangles semantics in a way that CSS does not.

Dynamic content (such as animated elements) and even some amount of user interaction is well handled by CSS to the extent that it more affords designers making pages such that that stuff can be turned off, ignored, overridden. That’s much more difficult with JavaScript and the virtual DOM. A simple wget -qO- |sed 's;";\n;g' |grep mp3$ is not as easily done with a JavaScript-laden page. CSS doesn’t (as often) get in the way of access the page’s content in a broader, more accessible way.

Now, I do think approaches like “object-oriented CSS” are completely misguided, adding an additional layer into something that was already meant to be the glue between layers. But since the cure for that is to allow the CSS layer to be messy and complex, I have sympathy for people making or using things like SASS or Emacs macros. I think that’s good actually. Tools are our friend here. This webpage has just a few lines of CSS but even then I’ve generated those lines using Liquid conditionals so that, for example, pages that don’t have a blockquote don’t style how blockquotes look.

One opposite approach, Tailwind CSS, I’m not fond of either, since it uses a redundant level of classes but it doesn’t harm anyone else, it’s just a cockamamie way to work.

But a good argument against CSS

Really the only “style” I wanna add to the older, pre-style web pages is max-width on the text but that shouldn’t have to be server-side. There should just be a good default, narrower max-width for the body text on older, unstyled web pages. Server-side styling (the font-size tags and friends) was a mistake.

In practice, I’ve been enjoying epub novels, email, text messages, IRC, and Atom/RSS feeds more than web pages for the past several years. 🤷🏻‍♀️

The web is getting ruined by mandatory darkmode, tracking and popups. Popups have been a scourge on the web since time immemorial but for a while we were able to successfully block them. With CSS that’s way harder.

So yes, CSS is bad if plain text is on the menu, which I’d rather choose any day of the week.

Styling and typography are good things! But it should be client side.