currentColor is a CSS keyword that lets a property use the element’s computed font color when direct inheritance is otherwise unavailable. It is especially useful when styling controls whose borders should follow nearby text. section 10.3.3
Matching a form-control border to its text
Set the border color to currentcolor: `border: 1px solid currentcolor;`. A checkbox or radio button can then use the same color as its label text while its size scales with the label’s font size. section 10.3.3
Listing 10.9 Styled radio and checkbox inputs
input[type="radio"],
input[type="checkbox"] {
appearance: none;
background-color: var(--background);
margin: 0;
width: 1.75em;
height: 1.75em;
border: 1px solid currentcolor; #1
display: inline-grid; #2
place-content: center; #2
}
input[type="radio"] { border-radius: 50% }
input[type="checkbox"] { border-radius: 4px }
See currentcolor applied in the complete radio-button and checkbox styles, alongside em-based sizing, inline-grid layout, and shape-specific border radii. section 10.3.3
