linkedlist:

CSS "currentColor"

#10 · · CSS

currentColor is a predefined color name. But it has a special meaning:

The currentcolor keyword represents the value of an element's color property. This lets you use the color value on properties that do not receive it by default.

If an element has a color assigned, you can "inherit" that specific color with the currentColor keyword. Given the code below, all paragraphs would have a border on the left. The border color would be blue, unless you apply the red class which would change both the color and the border color to red.

p {
  color: blue;
  border-left: 0.5em solid currentColor;
}
p.red {
  color: red;
}