Interview Question

What are custom properties?

Custom properties create reusable values that still participate in the cascade.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

Custom properties are author-defined CSS properties whose names begin with two hyphens. • Their values are substituted with the var() function. • They inherit by default and can vary by selector or media query. • Registered custom properties can define syntax, initial value, and inheritance behavior.

💡 Simple Example

:root { --space: 1rem; } .card { padding: var(--space); }

⚡ Quick Revision

Custom properties create reusable values that still participate in the cascade.