Skip to content

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

@argyleink

Description

@argyleink

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions