Web Design

Interpolating Numeric CSS Variables

August 30, 2022
Interpolating Numeric CSS Variables

We can make variables in CSS pretty easily:

:root {
  --scale: 1;
}

And we can declare them on any element:

.thing {
  transform: scale(--scale);
}

Even better for an example like this is applying the variable on a user …


Interpolating Numeric CSS Variables originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Read More

Our latest news

Read the latest news, articles and tips from Add On IDX

Want to learn more?

Signup