Idea: When (if) statements in CSS
hastebin.com
Idea: When (if) statements in CSS
1–10 of 24 posts
Re: Idea: When (if) statements in CSS
#2looks like SASS or LESS.
Re: Idea: When (if) statements in CSS
#3Looks cool. My one thought is replace @when with @if, to make life easier for every programmer ever.
Re: Idea: When (if) statements in CSS
#4This is a lot like CSS expressions right?
If they weren't horrible for performance and not standard they'd probably be fairly cool:
http://developer.yahoo.com/blogs/ydn/posts/2007/07/high_perf...
Re: Idea: When (if) statements in CSS
#5This 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 to become turing complete.
Re: Idea: When (if) statements in CSS
#6Looks cool. My one thought is replace @when with @if, to make life easier for every programmer ever.
Depends on if the OP means this should be event-driven/dynamic or not. The "when" seems to imply that it should be. When .widget becomes larger than 300px (screen resize/flip, for instance), then the font-size should become larger.
If that is OP's intention, then I feel @when is more appropriate than @if
Re: Idea: When (if) statements in CSS
#7Non-sense. This is relevant in JS not CSS.
Re: Idea: When (if) statements in CSS
#8This is a disaster waiting to happen. CSS becoming turing complete, and even if by magic not, this would introduce logic where none should be, its best kept in JavaScript where its home is.
Re: Idea: When (if) statements in CSS
#9This is a horrible idea.
Re: Idea: When (if) statements in CSS
#10take a look at LESS CSS. It does exactly this and more. http://lesscss.org/