CSS·Advanced·Conceptual·1 min read
What's a common mistake when using custom properties for a spacing or type scale shared with JavaScript?
Short interview answer
Defining the scale twice, once in CSS custom properties and once in a JS constants file, lets the two drift out of sync; a more robust approach reads the same values from one source, either generating the CSS from the JS tokens at build time or reading the custom property values from computed styles at runtime.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.