0

I want to create an override chain with variables.
So as long as the variable for a specific headline isn't set it takes the one from above.
Example code would look like this:

:root{
  --h1-font: "Rubik";
  --h2-font: unset; /* <-- Inherit from h1 */
  --h3-font: unset; /* <-- Inherit from h2 */
}

h1, h2, h3 {
  font-family: var(--h1-font);
}

h2, h3 {
  font-family: var(--h2-font);
}

h3 {
  font-family: var(--h3-font);
}

Would the unset value invalidate the previously set one?

Ayes
  • 15
  • 5

0 Answers0