Open Bug 647556 Opened 13 years ago Updated 2 years ago

CSS media queries should support parens better

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

People

(Reporter: bugzilla, Unassigned)

Details

In 2 places in my CSS, I've now come across an example of where it would be nice for the CSS parsing system to support parentheses better.  The first example is this:
@media not all and ((-moz-windows-classic), (-moz-windows-default-theme), (-moz-windows-theme: aero)) { ... }

So I want the query to match if it's NOT the case that one of the '-moz-windows' features match.  The second parens around those three comma-delimited features is not supported by CSS media queries right now.

The second example is:
@media all and (not -moz-windows-theme: aero) and (-moz-windows-default-theme) { ... }

This is saying that I want the query to match if the windows theme ISN'T Aero, but it IS the windows default theme.  because 'not' can't be placed inside parens and has to be at the beginning, this doesn't work either, but it would be nice if it did.

By the way, these could all be rewritten to work using the current media query syntax right now if only it supported nested media queries.  So, if that's an easier implementation, an alternative would be just to enable nested media queries.

eg. One could write the second example like:
@media not all and (-moz-windows-theme: aero) {
  @media all and (-moz-windows-default-theme) {
    ...
  }
}
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.