It would be cool if currentWidth existed. Are there any other things like currentColor in the spec?
You're asking for a list of values whose computed values are relative to other values.
And that list is short. If we comb through the CSS 3 Values and Units Specification, we find that:
inherit takes the parent value.
unset can operate like inherit.
currentColor uses the current font color.
These are units that specify relative values:
% is a percentage of the parent value.
em is relative to the current font size. rem is similar, but to the root element's font size.
vw, vh, vmin and vmax are all relative to the viewport.
ex, to the height of the current font -- sort of counts.
ch, to the width of the "0" character in the current font -- also sort of counts.
These functional values don't exactly count but are worth mentioning:
calc() allows mathematically-calculated values.
toggle() lets child elements cycle through values.
attr() returns the value of an element's attribute.
And historically:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With