- From: EricSL via GitHub <noreply@w3.org>
- Date: Tue, 21 Oct 2025 09:42:17 +0000
- To: public-css-archive@w3.org
EricSL has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-mixins-1][css-values-5] A general inheritance syntax == A number of proposals suggest a need for multiple types of inheritance. #12987 notes that in functions it may be desirable to support `inherit()` meaning to look in the DOM parent as it does elsewhere, in addition to its proposed meaning to look up the call stack. #12604 proposes support for reading vars from a container. #12927 proposes a new type of var lookup for mixins that is very different from ordinary var lookup, and in discussion an additional novel lookup behavior is proposed for scoped mixins. I'd like it to be clear at use site what type of lookup is being done, and if a sufficient variety of behaviors are in demand then it may be better to create a syntax for describing the inheritance desired rather than a variety of inherit functions. This could take the form of an additional argument to `inherit()`, but it could also allow dispensing with `inherit()` altogether. Consider: ```css var(--x from parent) /* Look in DOM parent; normal use case for inherit() */ var(--x from caller) /* Function call stack case */ var(--x from --my-container) /* Instead of container-var() */ var(--x from definition) /* Re-evaluate the definition of --x here; standard mixin use case. */ var(--x from scope) /* Supports scoped mixins */ /* No use case in mind, but could be considered in the future */ var(--x from parent parent) /* Two steps up DOM tree */ var(--x from --my-container parent parent parent) /* Great thing about inventing a syntax is you can do things like this that you'd never invent a function for. */ var(--x from host) var(--x from root) ``` Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12990 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 21 October 2025 09:42:18 UTC