CSS: getting started

Lesson 08 · 10 min

Variables and layers

--color on :root. Change the theme without hunting for 40 hex codes in the file.

10 minLesson 8 of 8Practice includedAsk AI on any point

:root { --bg: #fff; --ink: #111; } and color: var(--ink). If the variable is missing, the second argument is used: var(--accent, navy). This is plain CSS, not a preprocessor. Themes: a different class on html redefines the same names.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.