this post was submitted on 23 Oct 2025
100 points (97.2% liked)

Web Development

4711 readers
8 users here now

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

Related Communities

Wormhole

Some webdev blogsNot sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

CreditsIcon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS
 

After years of developer frustration and questions on online forums, it’s finally happening: CSS is getting an if() function to apply styling when a condition is met. For the first time, developers can make logical decisions directly in stylesheets, without separate code blocks. This opens up whole new possibilities for web designers.

top 20 comments
sorted by: hot top controversial new old
[–] trolololol@lemmy.world 14 points 3 days ago (1 children)

What an abomination

I'm just curious what kind of bad code is going to be around when this gets widespread.

[–] python@lemmy.world 2 points 3 days ago

No worries, we really bad web developers have all switched to React long ago 😎 So no CSS here, just Material-UI's "sx" attribute plastered over every single component.

[–] phneutral@feddit.org 7 points 3 days ago

This breaks with the foundations of CSS. You already can build if-like statements especially since the implementation of custom properties. It doesn’t have to be that explicit — quite the contrary: putting if() into every property will make them bloated and harder to understand.

[–] mormund@feddit.org 15 points 4 days ago

Only in Chromium for now. Also I don't see how it adds any new capabilities? I guess it is a little nicer syntax wise in some cases, but I might still prefer SCSS nested declarations instead.

[–] fubarx@lemmy.world 6 points 3 days ago

Slow-walk to plain scripting.

[–] fox2263@lemmy.world 7 points 4 days ago (1 children)

It should be like CSS5 by now with all the stuff they’ve added

[–] phneutral@feddit.org 1 points 3 days ago

After CSS3 they switched to rolling releases and dropped any numbers, AFAIK.

[–] monogram@feddit.nl 4 points 3 days ago (1 children)

Since flexbox I haven’t seen any useful updates to css.

This just gatekeeps alternative browsers from taking part.

[–] XiberKernel@lemmy.world 4 points 3 days ago* (last edited 3 days ago)

I would argue grid, :has(), var(), and native nesting have been just as important steps forward.

[–] SatyrSack@quokk.au 6 points 4 days ago (3 children)

When was the last time a feature this huge was added to CSS?

[–] 0xDREADBEEF@programming.dev 12 points 3 days ago* (last edited 3 days ago)

CSS Nesting

.foo {
    .nested {
        property: value;
    }
}

@container and @scope were pretty big in my opinion.

[–] Kissaki@programming.dev 3 points 3 days ago

Quite regularly, tbh.

[–] MadMadBunny@lemmy.ca 4 points 4 days ago

O.M.G. Finally!!!!

[–] sik0fewl@lemmy.ca 3 points 4 days ago

JSSS had this 30 years ago!

[–] 30p87@feddit.org 2 points 4 days ago (1 children)
[–] 30p87@feddit.org 1 points 4 days ago* (last edited 4 days ago) (2 children)

When <if cond="true"></if> and <set var="x" val="lol">?

[–] TeamAssimilation 8 points 4 days ago

Can’t wait to have business logic in my CSS!

[–] 4am@lemmy.zip 4 points 3 days ago (1 children)
[–] 30p87@feddit.org 2 points 3 days ago

Yeah, that's the point... CSS has conditionals now, so when will we get HTML conditionals and variables?