import type { Config } from "tailwindcss"; import { PALETTES, paletteVarName, themedShades, type PaletteName, } from "./lib/theme-palette"; // Shades that flip between the dark and light schemes resolve through CSS // variables set by ThemeRoot (app/_layout.tsx) from lib/theme-palette.ts, so // `text-zinc-100` / `text-red-400` darken under the Light theme (#450) with no // call-site changes. Shades that don't flip keep Tailwind's static value. // extend deep-merges, so each palette only lists its themed shades. const themedPalettes = Object.fromEntries( (Object.keys(PALETTES) as PaletteName[]).map((palette) => [ palette, Object.fromEntries( themedShades(palette).map((shade) => [ shade, `rgb(var(${paletteVarName(palette, shade)}) / )`, ]), ), ]), ); export default { darkMode: "class", content: [ "./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", ], presets: [require("nativewind/preset")], theme: { extend: { colors: { ...themedPalettes, // Chrome tokens resolve through CSS variables so the app theme // (lib/app-themes.ts, applied by ThemeRoot in app/_layout.tsx) can // retint them at runtime. Channel-triplet + form keeps // opacity modifiers (bg-surface-light/70 etc.) working. Defaults live // in global.css :root. background: "rgb(var(--color-background) / )", surface: "rgb(var(--color-surface) / )", "surface-light": "rgb(var(--color-surface-light) / )", border: "rgb(var(--color-border) / )", primary: "#3b82f6", success: "#22c55e", warning: "#f59e0b", danger: "#ef4444", download: "#3b82f6", upload: "#22c55e", }, }, }, plugins: [], } satisfies Config;