-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
Description
Spec: https://drafts.csswg.org/mediaqueries-5/#custom-mq
The intro paragraphs give as motivation for custom media queries:
the same media query may be used in multiple places, such as to qualify multiple
@importstatements.
[...] In this way, a media query used in multiple places can instead be assigned to a custom media query,
This makes it sound like we could write something like:
@custom-media --narrow-window (max-width: 30em);
@import url("mobile.css") (--narrow-window);
@import url("more-mobile.css") (--narrow-window);However, that doesn't actually seem legal, per css-cascade (emphasis mine):
Any
@importrules must precede all other at-rules and style rules in a style sheet (besides@charset, which must be the first thing in the style sheet if it exists), or else the@importrule is invalid.