Re: [csswg-drafts] Proposal: Custom CSS Functions & Mixins (#9350)

Functions:

I agree with @tabatkins notes above. My preference is for a declarative execution model, and explicit shadowing of external variables. I do have one question about the proposed shadowing syntax. Can external variables be used as defaults, or only through the `using` syntax? Are these two approaches functionally identical?

```css
@function --all-args(--one: 1, --two: var(--two)) { … }
@function --using(--one: 1) using (--two) { … }
```

Mixins:

> This is close to Container style queries… But it's missing something atm

Style queries _can be used_ as a rough stand-in for _some_ mixins, but they work in fundamentally different ways – and allow a whole range of different use-cases. I don't think we should conflate them just because there's some overlap. But to the specific question: style queries can't style the container that they query because that would be a cyclic behavior. This wasn't an oversight in the design, it's a fundamental requirement for them to work as intended. Mixins don't have that limitation because they don't impact selection. 

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


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

Received on Friday, 9 February 2024 00:21:14 UTC