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.

all 12 comments

sorted by: hot top controversial new old
[–] 14 points 1 year ago (1 child)

What an abomination

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

  • source
  • hideshow 1 child comment
  • [–] 9 points 1 year ago

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

  • source
  • [–] 7 points 1 year ago

    Slow-walk to plain scripting.

  • source
  • [–] 5 points 1 year ago

    O.M.G. Finally!!!!

  • source
  • [–] 6 points 1 year ago (3 children)

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

  • source
  • hideshow 3 child comments
  • [–] 3 points 1 year ago

    JSSS had this 30 years ago!

  • source
  • [+] 4 points 1 year ago (1 child)