Re: @else in Media Queries

Sebastian Zartner <[email protected]>
Newsgroups gmane.comp.web.css.general
Message-ID <CAERejNYshjcCRODdwbmAW7tx5j7VFfXG49AqJ2cOGsEezsfzeQ@mail.gmail.com>
On 9 June 2016 at 22:58, Tab Atkins Jr. <[email protected]> wrote:
> On Thu, Jun 9, 2016 at 3:34 AM, Daniel Glazman
> <[email protected]> wrote:
>> If @else if added, it adds another major layer of complexity:
>> we can only negate a whole MQ right now and not a single component
>> inside a MQ so expressing the "compound" MQ relevant to an arbitrary
>> style rule could be very painful is not impossible. In short it means
>> that copy/paste of a given element with its stylistic information
>> between two different documents could lead to MQ of that form:
>>
>>   @media ...a media query... {
>>     /* nothing here */
>>     @else {
>>       p { color: red }
>>     )
>>   }
>>
>> Sorry, but that's ugly and that clearly sucks. From a UI perspective,
>> wow.
>
> I don't know what you're trying to say here. Can you flesh out the
> example with more detail?

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.

Sebastian
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.