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

Okay, I missed the pre-substitution you were doing. I like this now. I'm not 100% sold because it is weird that both kinds of variables are evaluated with `var()` but their inheritance works very differently with one evaluated early and the other late.

So another way of thinking about this is, `@local` defines a variable that doesn't inherit and also isn't visible outside its nested scope even on its element, but the definition of that variable (not the value itself) is copied into any nested rules. Furthermore, `inherit()` on such a property will look one lexical level up rather than up the DOM tree like for other properties. Is that right?

So you could also look at my `.two-in-green` selector as desugaring to:

```css
.two-in-green {
  @nest {
    @local --arg1: green;
    @nest {
      @local --col: inherit(--arg1);
      & > div > div {
        color: var(--col);
      }
    }
  }
}
```

Which in turn desugars to

```css
.two-in-green > div > div {
  @nest {
    @local --arg1: green;
    @nest {
      @local --col: inherit(--arg1);
      @nest {
        color: var(--col);
      }
    }
  }
}
```

Is this equivalent to what you are proposing?

-- 
GitHub Notification of comment by EricSL
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12927#issuecomment-3390595728 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 14:52:53 UTC