from Hacker News

CSS Stuff I'm Excited After the Last Csswg Meeting

by graylien on 7/21/24, 2:13 AM with 1 comments

  • by lofaszvanitt on 7/21/24, 4:06 AM

    More confusing and borderline idiotic syntax comes for CSS in the form of IF conditionals. CSS is already a syntax hell, an unreadable mess, but the author is excited... oh dear god. The asteroid is coming, He is excited... Really?

    Cut the bloat, what is this mongrelified thing?

    background-color: if(style(--weather: clouds) ? var(--clouds-color): var(--default-color));

    I tell you what it is. it is Holy shit level bullshit!

    Okay let's see another example.

    Conjured by some alien lifeform:

    width: if(media(width > 1200px) ? var(--size-l): var(--size-m));

    What about a semblance of sanity:

    width: if (media:width > 1200px) ? $size-l: $size-m;

    Much more readable isn't it? Strive for something like this please, don't make css look like a Silent Hill monster.