Live data from Hacker News

CSS Custom Functions are coming

bram.us

1–10 of 90 posts

Re: CSS Custom Functions are coming

#7
Taking bets now on how long after release it takes to end up with someone making a "JS in CSS" framework, but with the added wrinkle that they have to be serious about it, not just doing it as a joke.

So taking the article seriously and not just being glib:

This feels like a misunderstanding of how to write good CSS. Good CSS is a lot like SQL, which shouldn't be a surprise since it's centered around selectors. CSS is a set-based language. Adding general purpose functions that seem to abuse rule precedence to make conditional statements feels like a dirty hack to force CSS into an imperative model.

Now, maybe there is something to be said for the idea that, here we are, 30 years into having CSS, and people are still bad at set-description operations. Maybe there should be an imperative styling language. But it's a mistake to overload CSS to do it.

Post reply on HN