Answers for "how to use css color variables with alpha value"

CSS
2

add alpha value to 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);
}
Posted by: Guest on July-16-2021

Code answers related to "how to use css color variables with alpha value"

Browse Popular Code Answers by Language