Re: @else in Media Queries

Mark Brown <[email protected]>
Newsgroups gmane.comp.web.css.general
Message-ID <CAM4AczAdiwxZmF=teOy+wvVXQT4rHHqazAqeL12HmAURxE2ThA@mail.gmail.com>
On Sat, Jun 11, 2016 at 7:24 PM, Daniel Glazman
<[email protected]> wrote:
> On 11/06/2016 09:54, Mark Brown wrote:
>
>> Has anyone considered something like
>>
>>   @switch {
>>       @case C1 { ... }
>>       @case C2 { ... }
>>       @default { ... }      /* optional */
>>   }
>
> /me faints.

I'm not in a position to judge whether the problem with chained rules
that you have raised is serious enough to preclude their use. The
example just illustrates that that wouldn't prevent some other form of
multi-way branch being added.

Hopefully your objection isn't just to the choice of names. It could
just as easily be:

  @first-of {   /* use the first non-discarded rule */
      @when C1 { ... }
      @when C2 { ... }
      ...
      @otherwise { ... }    /* optional */
  }

Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.