AFAIK, currentColor was come from fill attribute value in SVG to tell that the SVG color must inherit to the surrounding text color. Normally, we use style="color: inherit;" for generic HTML elements. And for borders, without specifying border color, its color should inherit to the text color automatically. Example:
html{border:0solidgreen;}body{color:red;border:5pxsolid;/* a red border */border-color:inherit;/* a green border */}
currentColor native CSS?
AFAIK,
currentColor
was come fromfill
attribute value in SVG to tell that the SVG color must inherit to the surrounding text color. Normally, we usestyle="color: inherit;"
for generic HTML elements. And for borders, without specifying border color, its color should inherit to the text color automatically. Example:stackoverflow.com/a/13002311/1163000
Update: It becomes standard in CSS3 due to the SVG spec β w3.org/TR/css-color-3/#currentcolor π
Iya sih. Aku baru denger juga. Yang aku tau ya inherit. Tapi kayaknya pemakaiannya berbeda. Mungkin ya.
It is standard and has terrific browser support, clear back to IE9!
caniuse.com/#feat=currentcolor
The power is in using it for additional CSS properties beyond border color or SVG fill ππ» It can even be used in gradients.
But personally, I would prefer
current-color
orcurrentcolor
just so that it would match to the CSS naming convention πI hope this value becomes case insensitive in the future. Same hope for
viewBox
attribute in SVG. I would like to see it asview-box
orviewbox
.