Re: [csswg-drafts] [css-mixins-1][css-values-5] The inherit() function in custom functions (#12987)

One more suggestion, if we want to lean away from the lots of inheritance functions approach. The behavior of inherit depends on where the closest version of the var is defined. This could actually be defined one of two ways:
  
 - If the variable is defined for the current hypothetical element, then look in the parent of the hypothetical element, otherwise look in the DOM parent.
 - If the variable is defined in any hypothetical element, then look in the parent of the current hypothetical element, otherwise look in the DOM parent.

So these are a bit more magical, but I think either would normally do what the user expects. If you avoid giving your function parameters and locals the same names that you use for your custom DOM properties, then there should be no ambiguity about what is intended.

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


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

Received on Friday, 24 October 2025 09:58:25 UTC