So I'd like to use the inherited value if the own is not yet defined. If this behavior is hard to implement, maybe the specification can introduce another function to use inherited values explicitly, something like this:
--width: calc( inherited-var(--width) * 0.1 );
The solution suggested here (just use two different props) is not the answer, because I want my components to be "context-agnostic". Please tell me if my case is not clear enough, I'll try to provide some better example then. Thank you!
I have definitely needed this too. I'd support a parent-var() (or similar) function, though it's possible to have a more general form that works for any property (see #2864).
According to the Resolving Dependency Cycles section of the spec it's not possible to use
var(--property)
while defining the--property
itself.Here's an illustration of the problem I'd like to solve:
So I'd like to use the inherited value if the own is not yet defined. If this behavior is hard to implement, maybe the specification can introduce another function to use inherited values explicitly, something like this:
The solution suggested here (just use two different props) is not the answer, because I want my components to be "context-agnostic". Please tell me if my case is not clear enough, I'll try to provide some better example then. Thank you!