Skip to main content

Christopher Kirk-Nielsen

Christopher Kirk-Nielsen is a designer turned developer who loves code and '80s aesthetics. When he's got time to spare, he likes to learn, play video games, or make electronica music.

Article

Contextual Utility Classes for Color with Custom Properties

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

icon-link icon-logo-star icon-search icon-star