Skip to content

[css-mixins-1] Are @mixin rules valid within other at-rules? #12417

Open
@andruud

Description

@andruud

For example, are @mixin rules valid within @container?

@container (...) {
  @mixin --m() {
    /* style rules */
  }
}

If yes, we already know that --m() isn't defined conditionally based on CQ evaluation (https://drafts.csswg.org/css-conditional-5/#container-rule, last paragraph of chapter), but are the inner style rules affected?

div {
  @apply --m();
}

In other words, does the above @apply rule "remember" that the referenced mixin is enclosed by an @container? Any decision we make should hopefully answer the same question about @layer, @starting-style, etc.

My initial thought is that (for simplicity) we should make @mixin invalid within any at-rule except conditional rules with the "old school" processing model (i.e. currently @media and @supports).

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