Hacker News new | ask | show | jobs
by jenius 5171 days ago
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)
1 comments

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