What are CSS variables?
CSS variables (custom properties) store a value that you can reuse. You define them with --name and read them with var().
:root { --main-color: #0073aa; }
a { color: var(--main-color); }
button { background: var(--main-color); }
Change the variable once and every place that uses it changes. They are also easy to change with JavaScript, for themes. See CSS Variables.
Learn more about the similar topics:
| Tutorials |
|---|
| CSS Introduction |
| CSS Inclusion |
| CSS Syntax |
| CSS Comments |
| CSS Variables |
| List of common CSS Properties |
| Exercises & Assignments |
|---|
| No Content Found. |