How do CSS Custom Properties cascade, and how does this affect their scope?
Instruction: Discuss the cascading nature of CSS Custom Properties and its implications on their scope within a document.
Context: This question evaluates the candidate's understanding of CSS Custom Properties (variables), focusing on their cascading nature and scope.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
CSS custom properties cascade in the same way that other CSS properties do. This means they are applied according to the Cascade and Inheritance principles inherent to CSS. The value of a CSS variable can be defined or redefined at any point in a stylesheet, and its scope is determined by the selector where it is defined...