Did you know that CSS Custom Properties can handle images too?

So you might be aware of CSS Custom Properties that let you set a variable, such as a theme color, and then apply it to multiple classes like this:
:root {
–theme: #777;
}

.alert {
background: var(—-theme);
}

.button {
background: var(—-theme);
}

Well, I had seen this pattern so often that I thought Custom Properties could only be used for color values like rgba or hex – although that’s certainly not the case! After a little bit of … Read article
The post Did you know that CSS Custom Properties can handle images too? appeared first on CSS-Tricks.

Link: https://css-tricks.com/did-you-know-that-css-custom-properties-can-handle-images-too/