TL;DR: Create colour variables grouped into modes such as light and dark, alias semantic tokens to those values, then apply the variables to components so switching a frame’s mode re-themes it instantly.
Variables turn a design system from a picture into a model, and theme switching is their most persuasive demonstration.
Step 1 Separate raw values from meaning
Create a primitive collection holding literal colours such as grey-900 or blue-500, with no opinion about where they are used. This is your palette, nothing more.
Step 2 Build a semantic collection
Create tokens that reference those primitives by purpose: surface-default, text-primary, border-subtle, action-background. These describe roles, not appearances.
Step 3 Define modes on the semantic collection
Add light and dark modes, and point each token at a different primitive per mode. Surface-default might reference white in light mode and grey-900 in dark mode.
Step 4 Apply semantic tokens to components
Because components use tokens rather than raw hex values, applying a mode to a parent frame re-themes everything inside it at once. You can show light and dark versions of the same screen side by side without duplicating components.
Step 5 Mirror front-end implementation
This structure maps closely to CSS custom properties, which makes handoff dramatically clearer. A developer translates your token names almost one to one.
Step 6 Name tokens by purpose, never appearance
A token called light-grey becomes a lie in dark mode. Purpose-based names survive theme changes; appearance-based names do not.
Step 7 Keep the primitive layer small
Resist creating one-off values. A tight palette forces consistency and makes the system maintainable.
Step 8 Test contrast in both modes independently
A pairing that passes in light mode frequently fails in dark mode, so verify accessibility for each rather than assuming one check covers both. Confirm variable and mode availability for your plan.