Skip to content

[css-mixins-1] Do we really need the @contents parameter? #12946

Description

@andruud

The @apply rule accepts a block following it, which can be used inside a @mixin rule using @contents:

@mixin --m(--color, @contents) {
  color: var(--color);
  &:hover {
    @contents;
  }
}

div {
  @apply --m(green) {
    text-underline: underline;
  }
}

The spec currently requires @contents to appear in the parameter list of the mixin for the above to be valid. Do we need that, though? Can't we just pretend that the @contents parameter is always there?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Friday Afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions