A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
| Concern | What to inspect | Typical failure |
|---|---|---|
| Core behavior | Modern Color Functions and Color Spaces | Color spaces are not interchangeable numeric sliders. Values that look evenly spaced in one model may not look evenly spaced in another. |
| 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. Use modern spaces when the design goal benefits from predictable lightness or gamut handling, and provide deliberate fallbacks where browser support requirements demand them. This keeps the rule understandable when content, theme, or viewport conditions change later.
<style>.demo { color:lab(50% 40 20); }</style><main class="demo">Example content</main>
Engineering judgment: Use modern spaces when the design goal benefits from predictable lightness or gamut handling, and provide deliberate fallbacks where browser support requirements demand them.
The useful mental model here is practical: how newer color functions express lightness, hue, alpha, and perceptual relationships. When a rule looks obvious but the browser produces something else, start by identifying which constraint or rendering phase is actually winning.
<style>.demo { color:oklch(0.65 0.16 250); }</style><main class="demo">Example content</main>
In production, Color spaces are not interchangeable numeric sliders. Values that look evenly spaced in one model may not look evenly spaced in another. 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 { background:rgb(20 30 40 / 60%); }</style><main class="demo">Example content</main>
Relative alpha is useful here because it demonstrates modern color functions and color spaces under a concrete input rather than as an abstract property list.
<style>.demo { color:#334155; color:oklch(0.35 0.03 260); }</style><main class="demo">Example content</main>
Fallback pair is useful here because it demonstrates modern color functions and color spaces 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.