Interview Question

What are CSS variables?

Custom properties store cascading values that var() can substitute.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

CSS variables usually means custom properties whose values can be reused with var(). • Custom property names begin with two hyphens. • They participate in the cascade and normally inherit. • A var() fallback is used only when the referenced custom property is missing or invalid.

💡 Simple Example

:root { --brand: royalblue; } .button { background: var(--brand, blue); }

⚡ Quick Revision

Custom properties store cascading values that var() can substitute.