Skip to content

Instantly share code, notes, and snippets.

@bwindels
Created April 9, 2020 07:55
Show Gist options
  • Save bwindels/9f4a67c40e4b9dd5f8dfda9a7a5a7b7e to your computer and use it in GitHub Desktop.
Save bwindels/9f4a67c40e4b9dd5f8dfda9a7a5a7b7e to your computer and use it in GitHub Desktop.
/* from https://stackoverflow.com/questions/40010597/how-do-i-apply-opacity-to-a-css-color-variable */
:root {
/* #f0f0f0 in decimal RGB */
--color: 240, 240, 240;
}
body {
color: #000;
background-color: #000;
}
#element {
background-color: rgba(var(--color), 0.8);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment