W3C home > Mailing lists > Public > www-style@w3.org > June 2016

Re: @else in Media Queries

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 13 Jun 2016 12:13:47 -0700
Message-ID: <CAAWBYDCmqVRj7X=-AyJsUgOic1rF4pLkZJJbi2PiZjiV-q4bEw@mail.gmail.com>
To: Mark Brown <mark@mercurylang.org>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sat, Jun 11, 2016 at 12:54 AM, Mark Brown <mark@mercurylang.org> wrote:
> On Sat, Jun 11, 2016 at 5:42 PM, Daniel Glazman
> <daniel.glazman@disruptive-innovations.com> wrote:
>> On 11/06/2016 09:34, Sebastian Zartner wrote:
>>
>>> Coming back to this option, why is nesting the @else rule that bad? Sure, in
>>> other languages you have it outside of the first block, but it clearly
>>> connects both visually and avoids the problems of a dangling @else
>>> block.
>>
>> Because an invalid MQ would trash the whole thing including the nested
>> @else, per error handling rules...
>
> Has anyone considered something like
>
>   @switch {
>       @case C1 { ... }
>       @case C2 { ... }
>       @default { ... }      /* optional */
>   }
>
> ?

That's identical to the current proposal, just with an extra level of
nesting.  I don't believe the current proposal is error-prone enough
to justify adding an additional rule.  (People don't screw up their
if-else chains regularly in other languages.)

~TJ
Received on Monday, 13 June 2016 19:14:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:47 UTC