Top 30 Theming Interview Questions and Answers
30 multiple-choice questions on Theming, drawn from 30 bites out of the 54 tagged Theming on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
What is the primary mechanism by which a themeable design system allows a single component library to display multiple visual styles?
Show the answer
Answer: b · By defining abstract design tokens that components reference, which can be swapped to change aesthetics.
Theming achieves multiple visual styles by abstracting visual properties into design tokens. Components are built to reference these tokens, allowing their aesthetic to be swapped by simply changing the token values without altering the component's underlying code or structure. Option A is incorrect because theming aims to avoid duplicating code.
Read the full bite: Theming: One Design System, Many Visual Styles
Question 2 of 30
Which strategy correctly separates visual identity from UI implementation while enabling instant runtime theme switching without forcing React re-renders?
Show the answer
Answer: a · Emit CSS custom properties from a three-tier token system and toggle themes via a data attribute on the HTML root.
A three-tier token system insulates components from raw values, and CSS custom properties let the browser switch themes instantly via a root attribute without JavaScript recalculation or React re-renders. Option D is tempting because React context is a standard state pattern, but it forces layout thrashing by recalculating styles across the entire component tree.
Read the full bite: Describe a robust architecture for implementing theming using design tokens
Question 3 of 30
Which CSS strategy best mirrors a Figma two-tier token system with Light, Dark, and High-Contrast modes?
Show the answer
Answer: d · Semantic custom properties reference primitive variables and are redefined under theme attribute selectors like [data-theme="dark"].
Redefining semantic custom properties under theme selectors preserves the abstraction where components use only semantic tokens, matching Figma's mode behavior. Option A breaks this architecture by letting components bind directly to primitives, creating maintenance debt when brand values change.
Read the full bite: How would you structure a multi-theme color system in Figma and CSS?
Question 4 of 30
Why should a nested ThemeProvider deep-merge its overrides onto the inherited theme rather than replace it entirely?
Show the answer
Answer: c · So a subtree can change only specific tokens while inheriting the rest of the global theme
Deep-merging lets a subtree override just what differs and inherit everything else, which is the point of layered theming. Full replacement forces redeclaring all tokens, and overrides should be scoped, not mutate the global theme.
Read the full bite: Architecting global and local theming with context
Question 5 of 30
When architecting a scalable light/dark theme system in Figma using variables and styles, where should the mode-switching logic primarily reside?
Show the answer
Answer: b · In semantic color variables, by aliasing different primitive values per mode and applying those variables to styles.
Semantic variables act as the raw engine for mode switching by aliasing different primitives per context, while styles should consume those variables rather than own the logic. A is a common misconception because Figma styles cannot directly switch modes, and D mirrors the inefficient practice of manually swapping libraries.
Read the full bite: How would you structure Figma colors for light and dark themes?
Question 6 of 30
In this architecture, what is the primary responsibility of the custom React Context provider?
Show the answer
Answer: c · To hold the current mode string and toggle function while the CSS-in-JS ThemeProvider injects derived tokens into styles
The custom Context manages state and actions such as the mode string and toggle, while the CSS-in-JS ThemeProvider is what actually injects the derived theme tokens into component styles. Option B describes the library provider's job, and option D combines prop drilling with unnecessary rebuilds, both listed as common anti-patterns.
Read the full bite: Implement a light/dark theming system with CSS-in-JS and React Context
Question 7 of 30
When updating a global theme in React, why does mutating a CSS custom property avoid subtree re-renders compared to updating a Context theme object?
Show the answer
Answer: a · CSS custom properties are mutated outside React's state, so only the browser recomputes styles without reconciliation.
CSS custom properties live outside React state, so mutating them via setProperty updates the stylesheet without triggering subtree reconciliation. The most tempting distractor claims variables work inside media query expressions, but var() is only valid in property values, not selectors or query expressions.
Read the full bite: CSS Custom Properties vs JS Theme Object in React
Question 8 of 30
To implement a dynamic light/dark mode, how should you set a component's color to ensure it updates automatically when the device's theme changes?
Show the answer
Answer: a · Set the color using a theme attribute reference, like "?attr/colorPrimary".
Using a theme attribute (`?attr/`) creates an indirect reference that is resolved at runtime against the currently active theme, allowing the UI to update automatically. A direct color reference (`@color/`) is resolved at compile time and will not change with the theme.
Read the full bite: Android Style vs. Theme and Attribute Resolution
Question 9 of 30
What is the key benefit of using "?attr/myCustomColor" in an Android layout XML instead of "@color/myFixedColor"?
Show the answer
Answer: d · It enables the referenced color to change dynamically based on the active Theme at runtime.
The primary benefit of using "?attr" is that it provides a layer of indirection, allowing the concrete color value to be resolved at runtime based on the currently applied Theme. This is crucial for features like dark mode. In contrast, "@color" is a direct reference resolved at compile time, making its value static.
Read the full bite: Styles vs. Themes and Attribute Resolution in Android
Question 10 of 30
Which scenario presents a fundamental limitation for implementing React Theming with Context API and CSS-in-JS?
Show the answer
Answer: d · Developing components for an application utilizing React Server Components (RSC).
The card explicitly states that this pattern's primary limitation is its reliance on client-side React Context, causing it to fail in React Server Components (RSC). While simple style overrides (Option B) are a case where the pattern is overkill, it's not a fundamental limitation of its mechanism, and options C and D describe core use cases or benefits.
Read the full bite: React Theming: Context API and CSS-in-JS
Question 11 of 30
Why can CSS custom properties switch themes at runtime while Sass variables cannot?
Show the answer
Answer: c · Custom properties resolve live in the browser and cascade, while Sass compiles to fixed values
Custom properties exist at runtime and respond to cascade overrides, so reassigning them on a scope reskins instantly. Sass variables are resolved at build time into static values, so they cannot change after compilation.
Read the full bite: How custom properties enable dynamic theming
Question 12 of 30
You are choosing an encapsulation strategy for a design-system widget deployed on pages your team controls. What tradeoff makes Shadow DOM a worse default than build-time scoping?
Show the answer
Answer: d · Shadow DOM blocks global theme inheritance and complicates SSR, whereas build-time scoping keeps the component in the global document for natural theming and trivial server rendering.
Build-time scoping preserves the cascade and produces plain HTML that renders easily on the server, while Shadow DOM forces explicit theming contracts and client-side shadow root creation. Option B is wrong because hashed classes only stop accidental selector collisions; host JavaScript can still deliberately query and mutate internals.
Read the full bite: Shadow DOM vs build-time scoping for third-party widgets
Question 13 of 30
For implementing a runtime dark-mode toggle, why is a CSS custom property the right tool rather than a Sass variable?
Show the answer
Answer: d · Custom properties live in the browser and can be overridden after compilation, while Sass variables are fixed at build time
Custom properties exist at runtime and respond to cascade overrides, so a theme selector can reskin live. Sass variables are substituted at build time into static values and cannot change afterward.
Read the full bite: Sass variable versus CSS custom property
Question 14 of 30
Why emit theme values as CSS custom properties rather than relying solely on Sass variables for a light/dark mode system?
Show the answer
Answer: b · Custom properties resolve at runtime, so themes switch without recompiling
CSS custom properties resolve in the browser, so a single attribute change reskins the page with no rebuild. Sass variables resolve at compile time, so changing them requires recompiling and shipping new CSS.
Question 15 of 30
Why is referencing a semantic token like color-button-bg preferable to hardcoding a hex value in the button's CSS?
Show the answer
Answer: a · The named token centralizes the decision so a rebrand updates one source instead of every component
A named token puts the design decision in one place, so changing it propagates everywhere. Hardcoded hex values scatter the decision and force manual edits across components when the brand changes.
Question 16 of 30
A developer wants all Button components in their Compose app to automatically use the correct primary color for both light and dark themes without manual intervention in each button's code. Which aspect of Compose theming primarily enables this?
Show the answer
Answer: d · Wrapping the entire UI in a Theme composable that provides a ColorScheme to MaterialTheme.
The card states that wrapping the UI in a Theme composable allows any component inside to access styles from MaterialTheme, and standard components like Button automatically read from MaterialTheme to style themselves. Option C describes a manual approach within a custom component, which bypasses the automatic, centralized benefit of the core theming system for standard components.
Read the full bite: Theming in Compose: Style from a Single Source
Question 17 of 30
In a token-based theming architecture, why should components reference semantic tokens rather than primitive tokens?
Show the answer
Answer: b · Semantic tokens let a theme remap meaning-to-palette in one place, keeping components theme-agnostic
Semantic tokens decouple components from specific values; a theme just remaps semantics to different primitives, reskinning everything without touching components. Reading primitives directly hardwires colors and breaks theming.
Question 18 of 30
For light and dark themes from tokens, what does the generated CSS typically look like?
Show the answer
Answer: d · The same semantic custom properties defined under :root and under a [data-theme=dark] selector
Emitting the same semantic custom properties under :root and a dark selector lets one shared stylesheet switch via the cascade. Separate full stylesheets duplicate code and prevent instant runtime switching.
Read the full bite: Light and dark themes with design tokens
Question 19 of 30
In a white-label multi-brand token system, what stays constant across all brands so components remain brand-agnostic?
Show the answer
Answer: c · The shared set of semantic token names that components consume
A fixed semantic contract lets each brand supply different primitives and mappings while components reference stable names. The raw values and bundles differ per brand precisely because they sit below that shared contract.
Read the full bite: Token architecture for white-label multi-brand
Question 20 of 30
Why use CSS custom properties with a data-theme override instead of shipping two full stylesheets for light and dark mode?
Show the answer
Answer: d · Components reference shared variables, so one attribute swap recolors everything without duplicating CSS
Variables centralize theme values so toggling one attribute updates the whole UI with no duplicated maintenance-heavy stylesheets. Custom properties are not inherently faster, and the same-origin and media-query claims are false.
Read the full bite: Implementing light and dark mode on the web
Question 21 of 30
Why are exposed CSS custom properties a cleaner override mechanism for a design system button than !important?
Show the answer
Answer: b · They are resolved as values through the cascade, avoiding specificity escalation entirely
Custom properties let consumers set a value the component already reads, so overriding needs no specificity battle. !important forces a win that every later override must then also escalate, creating unmaintainable CSS.
Question 22 of 30
Why should sub-brands override only the semantic token layer rather than copying the whole token set?
Show the answer
Answer: d · Component tokens reference semantics, so overriding semantics propagates changes while shared values stay inherited
Reference-based tiers let a thin semantic override flow into all component tokens while everything else stays inherited from core, avoiding drift. The compilation, browser, and immutability claims are incorrect.
Read the full bite: Structuring tokens for brand and sub-brand inheritance
Question 23 of 30
Why pair React Context with CSS custom properties in a themeable library rather than relying on Context alone?
Show the answer
Answer: b · CSS variables apply theme changes via styling without re-rendering every Context consumer
Emitting CSS variables lets style updates happen in CSS, avoiding cascade re-renders that pure Context-driven styling would trigger; Context still distributes the theme for logic. The other statements are false.
Read the full bite: Architecting a themeable React component library
Question 24 of 30
What is the decisive difference making CSS custom properties better suited to runtime theme switching than Sass variables?
Show the answer
Answer: a · Custom properties live in the cascade at runtime; Sass variables are resolved away at compile time
Sass resolves before the browser runs, so its variables cannot change live, whereas custom properties exist in the cascade and update instantly. The inheritance, JavaScript, and calc claims are reversed or false.
Read the full bite: CSS custom properties versus Sass for theming
Question 25 of 30
Which workflow best leverages Figma variables to let a single component support Light, Dark, and future themes with minimal maintenance?
Show the answer
Answer: a · Create a color collection with Light and Dark modes, apply those variables to component layers, and add new modes for additional themes.
Using a single variable collection with modes lets one bound layer property switch values automatically when the context changes, so adding a theme only requires new values in the collection. Swapping separate libraries or duplicating frames forces you to rebind or maintain parallel components, which breaks scalability and is exactly what variable modes are designed to avoid.
Read the full bite: How would you implement a light and dark mode theme switcher?
Question 26 of 30
A design team wants every component's fill to switch automatically between light and dark colors when a frame's mode is toggled, without editing each component by hand. Which variable structure achieves this?
Show the answer
Answer: c · Create a semantic collection with Light and Dark modes, where tokens like color-surface alias a different primitive per mode, and bind components only to those tokens
Binding components to semantic tokens that alias a different primitive per mode within one collection means toggling the frame's mode rethemes everything at once. Splitting light and dark into two separate collections, the second option, breaks the single mode switch that makes this scale.
Read the full bite: Manage light and dark themes with Variables and Modes
Question 27 of 30
For a B2B SaaS product sold to many enterprise clients, each needing their own branding, which UI strategy is most appropriate?
Show the answer
Answer: b · Building a white-label UI that allows clients to apply their own branding to a shared application.
The card states, "Use white-labeling when building a product that will be sold to multiple businesses who want it to carry their own branding. This is common in B2B SaaS." This directly matches the scenario. Developing a custom UI for each client (option A) is explicitly noted as a massive cost that white-labeling aims to avoid.
Read the full bite: White-Label UI: Design Once, Rebrand Infinitely
Question 28 of 30
A component class redeclares a custom property that is also set on :root. What value do elements inside that component see?
Show the answer
Answer: c · The component value, because it is scoped to that subtree and overrides the inherited one
Custom properties inherit through the cascade, so a value set on the component scopes to its subtree and shadows the global :root value there. Source order across unrelated selectors does not decide this; scope and specificity do.
Read the full bite: Declaring and scoping CSS custom properties
Question 29 of 30
When building a single button component that supports Light and Dark themes plus an optional icon, which division of labor between variables and component properties is correct?
Show the answer
Answer: b · Apply semantic Theme variables to the button fill and use component properties for the icon toggle
Semantic variables should own visual theme data like fills so mode changes cascade automatically, while component properties are reserved for structural logic such as toggling an icon. Creating separate Light and Dark master components is a tempting but wrong approach because it doubles maintenance and negates the purpose of variables.
Read the full bite: How do Figma Variables and component properties enable theme switching?
Question 30 of 30
Which mechanism primarily enables Jetpack Compose's declarative, hierarchical, and swappable theming system?
Show the answer
Answer: b · CompositionLocal implicitly providing design tokens down the UI tree.
CompositionLocal is the core mechanism that allows theme values to be implicitly passed down the composable tree, acting as a dependency injection system for design tokens. This enables hierarchical overrides and easy theme swapping, unlike global singletons which lack hierarchical scoping, or explicit parameter passing which is cumbersome.
Read the full bite: Jetpack Compose Theming for Design Systems
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.