A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
| Concern | What to inspect | Typical failure |
|---|---|---|
| Core behavior | CSS Custom Properties | Custom properties inherit like ordinary properties unless you design around a different scope. That makes them excellent for theme context and dangerous when a token leaks farther than intended. |
| Production test | Real content and constraints | The rule works only for the demo values |
| Maintenance | Scope and override path | A later fix creates another exception |
A good CSS change narrows the problem. Prefer semantic tokens such as --surface-muted over encoding raw implementation values into every component. This keeps the rule understandable when content, theme, or viewport conditions change later.
<style>:root { --brand:#2563eb; }</style><main class="demo">Example content</main>
Engineering judgment: Prefer semantic tokens such as --surface-muted over encoding raw implementation values into every component.
<style>.button { background:var(--brand); }</style><main class="demo"><button type="button">Example action</button></main>
A good CSS change narrows the problem. Prefer semantic tokens such as --surface-muted over encoding raw implementation values into every component. This keeps the rule understandable when content, theme, or viewport conditions change later.
In production, Custom properties inherit like ordinary properties unless you design around a different scope. That makes them excellent for theme context and dangerous when a token leaks farther than intended. That is the kind of bug that survives visual spot checks because the stylesheet is syntactically valid while the layout contract is wrong.
<style>.demo { color:var(--text-color, #111827); }</style><main class="demo">Example content</main>
Fallback is useful here because it demonstrates css custom properties under a concrete input rather than as an abstract property list.
<style>.card { --brand:#0f766e; }</style><main class="card">Example content</main>
Local override is useful here because it demonstrates css custom properties under a concrete input rather than as an abstract property list.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.