DESIGN & PRACTICE

Designing Dark Mode with Semantic Colors and State Checks

Color roles, readable text, and the states that matter.

Designing Dark Mode original concept example
Original examples · illustrative web demos, not Figma recordings

01Start with a task that must remain clear

The page lets a customer review items, delivery information, and payment status, then request a refund when permitted. Start by reviewing a failed refund request: order information should remain available, the reason should be readable, and the customer should understand how to continue.

Start with a task that must remain clear
Illustrative layout changes

If you only have a UI image, reconstruct a layered draft and inspect the layout relationships you still need to build. See the Dayline reconstruction and editing example.

Details and settings

A default screen alone would miss much of this work. If promotional emphasis and refund errors share a red treatment, making both brighter on a dark surface does not explain their different meanings.

02Name roles before choosing theme values

These colors are illustrative choices, not a brand specification. Use your existing design system's roles and themes when a project has them.

Name roles before choosing theme values
Illustrative layout changes
Details and settings
RolePurpose in this exampleLightDark
canvasPage background#F6F7F9#101820
surfaceOrder content panel#FFFFFF#182431
text/primaryItem name, amount, essential content#18212F#E9EEF5
text/secondarySupporting information and timestamps#526071#B7C4D4
text/errorRefund failure reason#B42318#FFB4AB

An order amount and an error can happen to share a color without sharing a semantic role. Revising error styling should not unexpectedly recolor an ordinary amount.

This table does not define the whole interface. Focus, selection, disabled actions, and button foregrounds and backgrounds still need appropriate roles and checks.

03Manage values with modes

Figma variables can hold different values in different modes. Bind the relevant properties to variables, then change the design's mode. This concerns the order page's appearance, which is separate from the theme of Figma's editor controls.

Manage values with modes
Illustrative layout changes
Details and settings

On a plan supporting variable modes, prepare light and dark modes for the color collection and apply the roles to the appropriate text or fills. Check the current official instructions and availability before following an older screenshot.

Figma: Modes for variables

When a paragraph fails to change, inspect that layer's actual variable and context. Record intentional component overrides. A single mismatch is not a reason to replace every occurrence of the same color.

04Calculate the actual foreground-background pairs

WCAG 2.2 distinguishes ordinary text, large text, and exceptions. For this exercise, treat the content as ordinary body text and check against 4.5:1. These calculations assume opaque text directly on the uniform surface color.

Calculate the actual foreground-background pairs
Illustrative layout changes
Details and settings
Text roleLight surfaceDark surface
Essential content16.19:113.49:1
Supporting information6.42:18.88:1
Error reason6.57:19.26:1

All six pairs exceed that threshold. This is not a complete accessibility assessment: images, gradients, or translucent overlays require checks against the resulting background. The table does not verify clipping, keyboard behavior, reading order, or the final rendered interface.

W3C: Text contrast requirements and exceptions

Supporting information still needs to be readable. Content required to review an order should not be treated as inactive text merely to make the palette look softer.

05Review the refund states

StateWhat this example needsWhat can be missed
Request availableA clear action and conditionsButton background changes without reviewing its label
SubmittingUnderstandable progress feedbackDisabled styling alone leaves the customer unsure whether the click worked
Request failedA reason, retained input, and next actionRed styling without an explanation
Request unavailableA readable reasonDimming the entire area hides the conditions too
Confirmation dialogThe relevant order, consequence, and way backReviewing the underlying page but missing the dialog, overlay, and focus
Review the refund states
Illustrative layout changes
Details and settings

These are proposed review checks, not implemented behaviors. Provide understandable error text and a non-color indication of selection. Necessary visual cues for controls and states also need review under the applicable non-text contrast rules; not every decorative border has the same requirement.

W3C: Use of color

W3C: Non-text contrast

06Scope an AI-assisted revision

For an existing order page, this original teaching prompt explores a separate dark-theme candidate. It has not been run in a model.

Scope an AI-assisted revision
Illustrative layout changes
Details and settings
Create a separate dark-theme candidate for this order details page. Preserve all items, amounts, addresses, wording, action positions, and layout. Add no decoration. Define roles for the page background, content surface, primary text, supporting text, and error text, then propose dark values. Keep the refund failure reason and retry action. List the buttons, disabled states, dialog, and focus treatment that still need review. Do not describe a generated image as completed variable binding.

Review hierarchy and readability before applying the candidate. A dark image does not establish variables, components, or runtime theme behavior. Those require separate implementation and verification.

Handoff materials should identify role names, theme values, states, and exceptions. Following the system appearance, offering a user choice, and remembering that choice are product implementation decisions that a color table does not settle.

Sources and example notes

We read Pixso's theme-switching tutorial for its role-based organization and state checks. The order scenario, colors, calculations, and scoped revision prompt here are our own. Its screens and assets are not reused.

Pixso: Theme switching with variables

This tutorial includes original concept art, fixed-view HTML state demonstrations, and six opaque-color contrast calculations. We have not built these states in Figma, tested production theme switching or devices, or run the prompt. The loops are not Figma recordings.