-
Notifications
You must be signed in to change notification settings - Fork 756
Description
Suppose we have:
div {
width: 100px;
height: 100px;
background-color: red;
}
@media not (min-width: 600px) {
div {
background-color: blue;
}
}
Then the @media rule follows
[[[
2.2.1. Negating a Media Query: the not keyword
An individual media query can have its result negated by prefixing it with the keyword not. If the media query would normally evaluate to true, prefixing it with not makes it evaluate to false, and vice versa.
]]]
And it gives an example.
However, I don't this this rule applies in this case. Check out Section 3. Syntax.
<media-query> = <media-condition>
| [ not | only ]? <media-type> [ and <media-condition-without-or> ]?
In our example, it matches <media-condition>, rather than "not <media-type>".
<media-condition> = <media-not> | <media-and> | <media-or> | <media-in-parens>
Cool. It looks like we are a <media-not>.
<media-not> = not <media-in-parens>
<media-in-parens> = ( <media-condition> ) | <media-feature> | <general-enclosed>
So this is a media-not, that has a media-in-parens that is a media-feature.
However, none of the browsers implement this. I expect because they treat the "not" as the prefix to a <media-type>, and then decide that the type is invalid.