Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mediaqueries-5] Allow @custom-media inside @supports or add @custom-supports #6611

Open
argyleink opened this issue Sep 15, 2021 · 1 comment

Comments

@argyleink
Copy link
Contributor

https://drafts.csswg.org/mediaqueries-5/#at-ruledef-custom-media

Consider the following styles where it feels wrong to use a custom-media inside supports right?

@custom-media --motionOK (prefers-reduced-motion: no-preference);
@custom-media --scrollTimeline (animation-timeline: works);

@media (--motionOK) { ... }
@supports (--scrollTimeline) { ... }

adding @custom-supports to the spec would allow proper type checking? making this the example instead:

@custom-media --motionOK (prefers-reduced-motion: no-preference);
@custom-supports --scrollTimeline (animation-timeline: works);

@media (--motionOK) { ... }
@supports (--scrollTimeline) { ... }

thoughts?

I very much love using @custom-media btw, very rad.

@dbaron
Copy link
Member

dbaron commented Sep 15, 2021

Today the CSSWG resolved to accept Tab's when-else draft proposal into Conditional 4, which has media() and supports() functions. Perhaps @custom-media should instead be something that goes in @when, and then there could be only one? Alternatively, maybe there should be a way of doing @supports queries inside @media rules, or vice-versa, or both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants