In CSS, we have the ability to access
currentColor which is tremendously useful. Sadly, we do not have access to anything like
currentBackgroundColor, and the
color-mod() function is still a ways away.
With that said, I am sure I am not alone when I say I’d like to style some links based on the context, and invert colors when the link is hovered or in focus. With CSS custom properties and a few, simple utility classes, we can … Read article “Contextual Utility Classes for Color with Custom Properties”