Divya Manian

RSS Feed Youtube Channel Github

Current Color in CSS

In the interest of documenting useless trivia about CSS3, here is something that I re-discovered thanks to nlogax: currentcolor (example).

Borders always render with the current color when a border color is not specified, but, till recently, there was no equivalent term for that use – now we do: currentcolor.

In CSS3, you can use this value to indicate you want to use the value of color for other properties that accept a color value: borders, box shadows, outlines, or backgrounds.

This value was first supported by Opera in 2009, since then, Firefox 3.5+, Chrome 1+, and Safari 4+. IE 9 yet does not support this though.

Now to find some practical use for this!