Re: [csswg-drafts] [css-values-4] inherit() function: like var() for parent value, for any property (#2864)

Here's my use-case:

I regularly will set a CSS variable in a parent element, then use that value for some dimension (like width). Then, in a child element, I'll use that same CSS variable and perform a `calc(..)` on it to derive a new value for the child element to use for some other dimension (like padding or border width). In this case, I'm only using the CSS variable because of its ability to be inherited down to the child and re-used.

It would be much nicer if, in those cases, I could skip the CSS variable altogether, and just have the child element reference a parent CSS property value, like for example: `border-width: calc(parent(width) / 10)`.

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


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

Received on Wednesday, 31 March 2021 02:51:37 UTC