Skip to main content

Custom Property with CSS Variables


CSS variables have access to the DOM, simply create variables with local or global scope.

DEMO

Color via CSS Variable

CSS

:root {
  --heading-color: limegreen;
}
h2{
  color: var(--heading-color);
}

Comments