CSS Variables & Media Queries
Lesson Overview: Build dark themes and responsive breakpoints cleanly using custom properties (--var) and @media.
Dynamic Theme Tokens
Declare variables on :root (--brand: #04AA6D;) and reference them via var(--brand). Override variables inside a .dark class to switch whole themes in milliseconds.
Test Yourself With Exercises
Reference a CSS variable named --accent:
.btn { background:
(--accent); }
Pro Tip: CSS variables cascade just like normal properties and can be read/changed from JavaScript.