W3C home > Mailing lists > Public > www-style@w3.org > November 2013

Re: [mediaqueries] Intentional that "not" is only usable in front of a media type?

From: Rune Lillesveen <rune@opera.com>
Date: Tue, 12 Nov 2013 10:23:59 +0100
Message-ID: <CANz6XvS3EyZMUoa8emCqO6mC1L8jSyuN7LcAY=nEzJ26KFjdXQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
On Tue, Nov 12, 2013 at 9:40 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> According to the grammar in Media Queries, the "not" keyword is only
> allowed in front of a media type.  You can't put it in front of a set
> of media features, like "not (color)".
> However, as far as I can tell, using a "not" negates the entire query,
> not just the type.  That is, "not screen and (color)" means "not a
> color screen", rather than "not a screen, but has color".
> Am I right in interpreting this?  If not, I need to revise the spec to
> make this more clear.

You are right.

> If I am, does anyone have any clue why this grammar restriction
> exists?  It seems more reasonable to let it apply to media features
> without a media type as well.


Should be possible to say "only (color)" too, even though that would
not be necessary for the intention** of introducing "only".

** It seems "only" was introduced to make things like "screen and
(monochrome)", which would match "screen" for HTML4 media attribute
parsing, not match by writing "only screen and (monochrome)" instead.

Rune Lillesveen
Received on Tuesday, 12 November 2013 09:24:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:36 UTC