Promptles
Frontend & Responsive Design

CSS Variables (Custom Properties)

intermediate

Definition

Named values you can define once and reuse all over a website's styles: like a brand color, a corner roundness, or a default spacing. Change the value in one place and every spot that uses the variable updates automatically.

In the wild

A brand decides its main blue should be slightly brighter. Because the original blue was stored in a CSS variable, the designer changes the value in one spot. And every button, link, and highlight across hundreds of pages instantly picks up the new shade.

More from Frontend & Responsive Design