Zest.

CSS: CSS variables

A short, tested CSS example for css variables. Copy it and adjust the names and paths for your project.

CSS
:root {
  --accent: #e0262f;
  --radius: 8px;
}
.button {
  background: var(--accent);
  border-radius: var(--radius);
  color: var(--text, white);   /* fallback */
}

Find it in Zest

Search for “css css variables” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More CSS examples

All CSS examples