Last active
November 30, 2021 14:17
-
-
Save anova/bdb01d5f126f36a3cc4c4b3c2f54f533 to your computer and use it in GitHub Desktop.
How do I apply opacity to a CSS color variable? (Stackoverflow answer)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--color-cultured-white: 242, 244, 247; | |
} | |
.element { | |
/* | |
How do I apply opacity to a CSS color variable? | |
https://stackoverflow.com/questions/40010597/how-do-i-apply-opacity-to-a-css-color-variable | |
https://stackoverflow.com/a/41265350 - BoltClock's answer | |
*/ | |
background-color: rgba(var(--color-cultured-white), 0.25); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment