Re: [csswg-drafts] [css-mixins-1] Expose locals inside apply's contents block (#12631)

> My _intuition_ right now is that the contents block should act the same as arguments and resolve all variables based on the applying element.

@tabatkins To clarify, what is `--color-from-element` on `<span>` here? (With `--bar` shadowing `--a` locally, as in the previous examples.)

```css
div {
  @apply --bar() {
    & > span {
      --color-from-element: var(--a);
    }
  }
}

div {
  --a: gold;
}

div > span {
  --a: tomato;
}
```
---

Will a contents block passed to a `@macro` behave the same way as a contents block passed to a `@mixin`?

-- 
GitHub Notification of comment by andruud
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12631#issuecomment-4101609590 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 21 March 2026 00:29:15 UTC