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

Re: @else in Media Queries

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 10 Jun 2016 11:42:01 -0700
Message-ID: <CAAWBYDA+wGvWSVrysufLRYCnJeNBhrKfUxiS2Y8UXtUSRioW1A@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Thu, Jun 9, 2016 at 10:34 PM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> On 09/06/2016 22:58, Tab Atkins Jr. wrote:
>> I'm not sure what you're trying to say here.  As the spec lays out
>> clearly in both definition and examples, @else is relative to the
>> *preceding* conditional rule, not an *enclosing* one.  Any enclosing
>> conditional is irrelevant here.
>
> The whole things starts smelling like the worst of hacks in CSS. So an
> editor removing one rule (the @media one) will have to carefully look
> if there is an @else after it. To do what? Remove it? Explode it?
> Keep it standalone (what does it even mean in that case...)?

This is literally how *every single programming language* works
(pedants pointing out esolangs, plz go away).  If you have an if-else
chain, and you remove the leading if block, you have to modify the
prelude to the next else-if to be just an if.

(Possible misunderstanding here - do you think an @else *arbitrarily
far down the page* will chain into the opening conditional?  If so,
that's wrong - they have be *immediately* following, with nothing
separating the two rules but whitespace and comments.)

In this case, that just means turning the @else into @when.  Or, if
it's the last @else and has no condition on it, just remove the
wrapping rule entirely.

>> It sounds like @media itself is a blocker on those editors for some
>> reason.  @else doesn't seem to make the situation any worse.
>
> When was the last time you implemented a Wysiwyg editor dealing with
> media queries and why don't you listen? Can you please for once accept
> what others are saying when you have no knowledge of that domain?

This tone is unnecessary.

You stated clearly that your survey of existing editors shows that
they can't even handle existing @media rules.  I don't know why this
is or what troubles they may be having, but @else is not a *new*
blocker here; at worst, it's stage 2 after they fix their existing
@media support.

If you could explain what the actual problem was, perhaps with
screenshots demonstrating why it's difficult in a WYSIWIG environment
specifically, I might be able to understand your point better.

~TJ
Received on Friday, 10 June 2016 18:42:48 UTC

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