Re: [csswg-drafts] [css-mixins-1] A var()-based model for mixin parameters (#12927)

> How would the following desugar? [...]

```css
@function --f1(--col) {
  result: var(--col);
}

.two-in-red {
  & > div > div {
    color: --f1(red);
  }
}

@function --g1(--col) {
  result: var(--col);
}

.two-in-green {
  & > div > div {
    color: --g1(green);
  }
}
```

> Also, the spec has a --triple-border example which has a :has(&) selector which would not inherit any vars; do we want to make it possible to propagate vars out as well as in?

Yeah, I was looking at that example earlier today (currently "Example 16"). This proposal does not change how that works. The inline issue associated with the example (currently "Issue 2") asks whether we should try to do something to avoid the "workaround" in the example, and in my opinion the answer is "no"; I don't really see it as a workaround. If you want to "capture" a certain computed value at a point in the inheritance chain and send it down, then the "workaround" is reasonable way to do it, and not something mixins can do automatically. In any case, it would be a separate issue.

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


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

Received on Friday, 10 October 2025 13:37:16 UTC