Back to Blog
The Dark Mode Problem: Why Your App's Dark Theme Is Just Inverted Colors That Nobody Can Read

The Dark Mode Problem: Why Your App's Dark Theme Is Just Inverted Colors That Nobody Can Read

You shipped the light theme, it looked great, and then a beta tester messaged you a screenshot at 11 p.m.: white text on a pale gray card, a nearly invisible border, and a button that vanished into the background. Their phone was in dark mode. You had "supported" it by flipping a switch, and the result was an app that looks fine in daylight and broken in bed. If that sounds familiar, you are in good company, and Dolfy.ai was built around exactly this kind of avoidable design debt.

Key Takeaways

  • Dark mode is not inverted light mode. It needs its own color decisions, usually 15-25 named color roles that each have a light and a dark value.
  • Pure black backgrounds with pure white text cause harsh contrast and "smearing" on scrolling; dark gray surfaces (around #121212) read better.
  • Contrast ratios still apply: WCAG asks for at least 4.5:1 for body text and 3:1 for large text and UI controls, in both themes.
  • Name colors by job (surface, text-primary, border) instead of by value (gray-900), and a second theme becomes a data change instead of a rewrite.
  • Test dark mode on a real device in a dim room before you ship, not just in a simulator.

Why does "just invert the colors" fail in dark mode?

Inverting colors fails because light themes rely on shadows, tints, and brand colors that stop working on dark surfaces. A drop shadow that gives a card depth on white is invisible on near-black, and a saturated brand blue that looks friendly on white can vibrate painfully against a dark gray background.

Designers solve this by expressing depth differently. In a light theme, a raised card is usually the same white as the page with a soft shadow beneath it. In a dark theme, elevation is typically shown by making higher surfaces slightly lighter, so a card sits a shade above the page behind it. Material Design's dark theme guidance, for example, recommends a dark gray base around #121212 rather than pure black, then layers lighter overlays on top as elevation rises.

Brand colors need the same care. A saturated color that passes contrast on white often has to be desaturated and lightened to stay comfortable on dark. That means your "primary" color is really two colors, one per theme, and treating it as one is where most dark modes go wrong.

Inline blog image 1

What is a color role, and why does it matter for theming?

A color role is a name that describes what a color does in the interface, such as "surface," "text-primary," or "border-subtle," rather than what it looks like, such as "gray-900." Each role then points to one value in the light theme and a different value in the dark theme.

This is the heart of a design system, which is simply a shared set of rules and reusable pieces that keeps every screen consistent. The color part of that system is stored as design tokens: named values for colors, spacing, type sizes, and similar decisions, kept in one place so that changing a token changes every screen that uses it.

If your components say bg-gray-100, switching themes means hunting through every file. If they say bg-surface, switching themes means changing what "surface" points to. A typical small app needs somewhere between 15 and 25 roles: a few surfaces, two or three text levels, borders, a primary and secondary accent, and the four status colors for success, warning, error, and info.

How much contrast does dark mode actually need?

Dark mode needs the same minimum contrast as light mode: the Web Content Accessibility Guidelines (WCAG) call for a ratio of at least 4.5:1 for normal text and 3:1 for large text and interface components like buttons and input borders. Dark themes make this easy to get wrong in both directions.

The first failure is too little contrast, such as medium gray text on a dark gray card that looks elegant on your monitor and unreadable outside. The second is too much: pure white (#FFFFFF) text on pure black (#000000) hits a 21:1 ratio, the maximum possible, and many people find long reading on it tiring because the glare bleeds around letterforms. Off-white text, around 87% opacity white in Material's guidance, on a dark gray surface is usually easier on the eyes.

A quick habit: check every text role against every surface it can appear on, in both themes. That is roughly a 6-by-4 grid for a small app, which takes about 20 minutes with a contrast checker and prevents the 11 p.m. screenshot.

Which parts of an app break first in dark mode?

The parts that break first are the ones that were never tokenized: images with white backgrounds, hard-coded icon colors, third-party components, and status bars. These are the same places that break in any redesign, and dark mode simply exposes them.

Here is the usual shortlist to audit:

  • Logos and illustrations exported with a white box behind them
  • Icons drawn with a fixed dark stroke that disappears on dark surfaces
  • Shadows used as the only separation between a card and its background
  • Status and system bars that stay light while the app goes dark
  • Charts and maps with their own palettes that ignore your theme
  • Text inputs whose placeholder text falls below 3:1 contrast

Inline blog image 2

How do you support dark mode in React Native and Expo?

In React Native, you read the user's system setting with the built-in useColorScheme hook, which returns "light" or "dark," and then choose a token set based on the result. Expo projects use the same hook, and you can set the app's userInterfaceStyle option to "automatic" so it follows the device instead of staying locked to light.

The pattern is simple once your colors are roles. You define two objects, one for each theme, with identical keys, and a small theme provider hands the right one to every component. Tailwind CSS users get a similar result through its dark: variant or by pointing utility classes at theme-aware values. TypeScript can enforce that both theme objects have exactly the same keys, so you can never ship a dark theme that forgot to define "border-subtle."

The same idea exists elsewhere: SwiftUI has color assets with light and dark variants, and Flutter has ThemeData with a separate dark theme. The tool changes, but the principle does not: roles first, values second.

How does Dolfy handle themes and design tokens?

Dolfy.ai treats the design foundation as its own step rather than something you bolt on at the end. Its Design OS methodology walks you through five steps: Product Definition, Data Model, Design Foundation, Screen Design, and Export. The third step, Design Foundation, is where the design-token system lives, so color decisions are made once, early, and by role.

That ordering is what makes a second theme cheap. Because screens are designed against tokens instead of hard-coded values, the components Dolfy exports as React Native with Tailwind and TypeScript types reference those roles. You can check the result on your own phone with the Expo Go preview or in the Web Preview before you commit to anything, which matters because dark mode problems rarely show up on a desktop monitor in a bright office.

Contrast with the common alternative: designing every screen in Figma with light colors, handing it to code, and discovering at the end that 40 components contain hard-coded hex values. Retrofitting dark mode at that point can easily cost a week or more of tedious find-and-replace, versus an afternoon of choosing a second set of values when the roles already exist.

A practical dark mode checklist for your next release

Before you ship a dark theme, run through this list on a physical phone, in a dim room, at normal brightness:

  1. List your color roles and confirm each has both a light and a dark value.
  2. Replace pure black with a dark gray base and pure white text with an off-white.
  3. Re-pick your brand and accent colors for dark surfaces instead of reusing the light ones.
  4. Check contrast for each text role on each surface: 4.5:1 for body, 3:1 for large text and controls.
  5. Replace shadow-only separation with lighter surfaces or subtle borders.
  6. Re-export logos and icons with transparent backgrounds.
  7. Confirm the status bar and keyboard follow the theme.
  8. Toggle the system theme while the app is open and confirm nothing flashes or stays stuck.

Most of that list takes under an hour once your tokens are in place. Without tokens, step 3 alone can swallow a weekend.

Frequently Asked Questions

Do I need dark mode in my first release?

Not necessarily, but you should structure your colors as roles from day one. Adding dark mode later is easy when your colors are tokens and painful when they are hard-coded, so the real decision is about architecture, not the theme itself.

Is a dark theme better for battery life?

On OLED screens, dark pixels use less power, so a dark theme can reduce battery draw, mostly at higher brightness. On LCD screens the savings are negligible, so treat battery as a bonus and not the main reason to build it.

Should dark mode follow the system setting or be a toggle?

Follow the system setting by default, since that is what most users expect, and offer a manual override in settings for people who want something different from their phone. Both options together cost little extra if your theme provider is already in place.

How many colors does a dark theme need?

A small app usually needs 15-25 color roles, each with one dark value. Fewer roles means a flatter-looking interface, while many more usually signals that roles are being created for one-off cases.

Design the second theme before you need it

Dark mode is not a feature you add; it is a consequence of how you named your colors on day one. Decide on roles, give each a value per theme, and check contrast on a real phone, and the late-night screenshot never arrives. If you would rather make those foundations part of the process instead of a cleanup job, Dolfy guides you through them step by step, from product definition to exported React Native components.