News for hackers. Stuff that matters.
Re:Idea: When (if) statements in CSS by jenius on Monday June 04, 2012 @09:37AM (#4063908)
You can already do things like this with stylus (http://learnboost.github.com/stylus/). As far as I can see, if you are thinking at this level with css you should be using a preprocessor for sure. I can't remember the last project I used vanilla css in.

Here's a totally silly example, but you can see the power:

    color-if-hidden(color)
      if @display == none
        color: color

    .hello
      display: none
      color-if-hidden(red)
Re:Idea: When (if) statements in CSS by yuchi on Monday June 04, 2012 @11:48AM (#4064481)
It's true, but you're not considering cascade rules, of course. How do you know that another selector has `display: inline`ed that element?

EDIT: typo