Compare CSS preprocessor mixins with CSS custom properties in terms of duplication and runtime flexibility.

Prepare for the CSS Mastery SAD Maintenance and CSA Stand Ups Test. With flashcards and multiple choice questions, ready yourself for the exam with hints and explanations for every question. Ace your exam today!

Multiple Choice

Compare CSS preprocessor mixins with CSS custom properties in terms of duplication and runtime flexibility.

Explanation:
The main idea here is how duplication happens and when values are resolved. CSS preprocessors’ mixins copy a set of declarations into every place you use them, so the final CSS ends up duplicating those rules. This duplication occurs at build time when the preprocessor runs, which can lead to larger output and more maintenance if you change the shared pattern later. CSS custom properties are real CSS variables that the browser resolves at runtime. They don’t copy whole blocks of declarations; instead, you define a value once and reference it with var(--name). Because the values cascade and can be overridden in different contexts (for example, changing a root or a theme container), you can switch themes without rewriting rules, giving runtime flexibility. That’s why this choice fits best: mixins duplicate code at build time, while CSS variables share values and can adapt to themes at runtime. The other statements aren’t accurate for common CSS workflows: mixins aren’t strictly limited to no parameters, and CSS variables don’t require a preprocessor nor are they fixed to build-time expansion.

The main idea here is how duplication happens and when values are resolved. CSS preprocessors’ mixins copy a set of declarations into every place you use them, so the final CSS ends up duplicating those rules. This duplication occurs at build time when the preprocessor runs, which can lead to larger output and more maintenance if you change the shared pattern later.

CSS custom properties are real CSS variables that the browser resolves at runtime. They don’t copy whole blocks of declarations; instead, you define a value once and reference it with var(--name). Because the values cascade and can be overridden in different contexts (for example, changing a root or a theme container), you can switch themes without rewriting rules, giving runtime flexibility.

That’s why this choice fits best: mixins duplicate code at build time, while CSS variables share values and can adapt to themes at runtime. The other statements aren’t accurate for common CSS workflows: mixins aren’t strictly limited to no parameters, and CSS variables don’t require a preprocessor nor are they fixed to build-time expansion.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy