CSS: currentColor

In the absence of widespread support for native CSS variables we can still take advantage of one type of variable – currrentColorThis permits inheritance of the color property to other properties in the element’s rules as well as the child elements.

This way we only need to set the color value and it’s updated everywhere it’s used.

See the Pen currentColor by Alan Dargan (CodePen.16446

There’s good support for this and even though the use cases aren’t exactly abundant it’s a useful CSS feature to be aware of.

Leave a Reply

Your email address will not be published. Required fields are marked *