In a `@if` what does `li` means related to the `li` inside the body? Absolutely nothing.
What could seriously be interesting instead is a property value selector similar to attribute selector. Something similar to `[@color != red]`
21–24 of 24 posts
In a `@if` what does `li` means related to the `li` inside the body? Absolutely nothing.
What could seriously be interesting instead is a property value selector similar to attribute selector. Something similar to `[@color != red]`
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)
EDIT: typo
This will allow never ending loops (two of these can @when each other) - css is not an imperative language that works from top to bottom, it's more of a state language where certain items override other. If you add this, the language will become turing complete, and then you'll have people disabling css just like they disable javascript. If you want this, you'll need to find a syntax that makes it impossible for css…
I don't really see why this syntax can't work as CSS does today? The last style with equal "weight". This idea can be implemented with the same idea.
You can make one rule depend on another, and then that rules depends on the first. This can cause a loop.
You could ignore one I guess, but how do you decide which? Do you use css order? Do you use the order of the page? What is there is an inline style? What is two elements have the style?
It's better not to make a syntax that can get you into trouble like that.