import { brands } from '@dangerousthings/tokens'; import type { ThemeBrand } from '@dangerousthings/tokens'; import { Section, CodeLabel } from '../components/Section'; interface TokensPageProps { brand: ThemeBrand; } export function TokensPage({ brand: brandId }: TokensPageProps) { const brand = brands[brandId]; if (!brand) return null; const darkColors = brand.dark; const darkEntries = Object.entries(darkColors) as [string, string][]; const lightColors = brand.light; const lightEntries = Object.entries(lightColors) as [string, string][]; return ( <>
Design token values for the active brand. Switch brands in the sidebar.
{`heading: ${brand.typography.heading}\nbody: ${brand.typography.body}\nmono: ${brand.typography.mono}`}
Body text — the quick brown fox jumps over the lazy dog
{'const monospace = "code";'}
{`bevelSm: ${brand.shape.bevelSm}\nbevelMd: ${brand.shape.bevelMd}\nbevelLg: ${brand.shape.bevelLg}\nradiusSm: ${brand.shape.radiusSm}\nradius: ${brand.shape.radius}\nradiusLg: ${brand.shape.radiusLg}`}
{`/* Generated CSS custom properties */\n--color-bg: ${darkColors.bg};\n--color-primary: ${darkColors.primary};\n--color-secondary: ${darkColors.secondary};\n--color-error: ${darkColors.error};\n--color-success: ${darkColors.success};\n--bevel-sm: ${brand.shape.bevelSm};\n--bevel-md: ${brand.shape.bevelMd};\n--font-heading: ${brand.typography.heading};`}