Re: Feature queries

Pascal Germroth <pascal@germroth.name> wrote:
> 
> If media-query like operators were allowed, we need no @else:
>   @if supports( display: run-in; ) { ... }
>   @if supports( not(display: run-in); ) {...}

Then you have to write the expression twice, yuck.  And @elif becomes
awkwardly verbose.

> I think few people would use @else anyway, but instead use cascading:
>   div {...} /* default case */
>   @if supports( foo: bar; ) { div {...} /* special case*/ }

Maybe, but IMO the if/else construction is clearer; especially when you
have some shared properties and some conditional.

div { /* common */ }

@if supports( ... ) { div { /* cool stuff */ } }
@else { div { /* fallback */ } }

The generic grammar probably can't handle

div {
  /* common */
  @if supports (...) {
     /* cool stuff */
  } @else {
     /* fallback */
  }
}

more's the pity.

zw

Received on Wednesday, 9 December 2009 21:29:11 UTC