Re: @else in Media Queries

On Fri, Jun 10, 2016 at 6:58 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Thu, Jun 9, 2016 at 3:34 AM, Daniel Glazman <daniel.glazman@disruptive-innovations.com> wrote:
>> My recommendation for @else is then the following: yes to @else but
>> we need to have boolean completion in MQs first, to be able to
>> serialize precisely the MQ relevant to a given style rule. That means
>> allowing negated single media features, OR operations and grouping
>> through parentheses. I'm pretty sure we'll have requests for that (if
>> we don't have them yet) anyway.
>
> We already have all of those.

Well, not quite. Florian's example on the issue tracker [1]
illustrates that you can't always write a separate condition that's
equivalent to an else, because of how unknown media features are
handled.

To make the set of operations complete, you could, for example, add a
function such as 'unknown(media-query)' which is true iff its argument
evaluates to unknown. So this doesn't seem a major hurdle.

On Fri, Jun 10, 2016 at 3:34 PM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> 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?

Can you explain how this is different from an editor for any other
language with an if-then-else construct?

Mark

[1] https://github.com/w3c/csswg-drafts/issues/112

Received on Friday, 10 June 2016 09:54:16 UTC