skip to content
Andrei Calazans

The currentColor keyword in CSS

/ 1 min read

Today I Learned


TIL in @JoshWComeau’s CSS for JS course: CSS has a keyword called currentColor that represents the value of the color property.

.box {
  color: hotpink;
  border: 1px solid currentColor;
  box-shadow: 2px 2px 2px currentColor;

currentColor above equals hotpink.

MDN currentColor keyword documentation