Skip to content

Theming

Mode, preset and density are attributes, not separate stylesheets. Components never change.

Light and dark

The dark class switches every color role. Put it on <html> for the whole app, or on any element to scope it:

import { ThemeScope } from "@/lib/theme";

<ThemeScope mode="light" preset="graphite">
  <RunReview />
</ThemeScope>

Overlays opened inside a ThemeScope (menus, dialogs, tooltips, toasts) mount inside it, so they keep the scope's theme.

Presets

PresetCharacterModes
graphiteNative and neutral, Mac-like materials, system bluelight, dark
flight-deckSoft graphite with a blue bias, ice-blue action, no glassdark
deep-spaceNear-black, nebula light, frosted glassdark

Each tool in a suite can pick its preset and keep its own character while clearly belonging to the same family. Presets without a light mode fall back to Graphite light.

Tokens

Colors use the shadcn role names (background, foreground, card, primary, muted-foreground, …) plus subtle-foreground, selection, status roles (success, warning, info, destructive, each with a readable -foreground text color) and chart roles. The source is packages/tokens/src/index.ts; pnpm tokens generates CSS, DTCG JSON and React Native values and fails if any declared pair misses WCAG AA.

React Native and Expo

Native apps cannot read CSS variables. Import the generated hex values instead:

import { colors, radii } from "@dtheo/tokens/native";

const card = colors.graphite.dark.card;