Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any other CSS properties like currentColor?

Tags:

css

It would be cool if currentWidth existed. Are there any other things like currentColor in the spec?

like image 559
corysimmons Avatar asked Feb 03 '16 19:02

corysimmons


1 Answers

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:

  • CSS 2 offers now-deprecated System Colors.
like image 119
Litty Avatar answered Nov 09 '22 04:11

Litty