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 ( <>

Tokens

Design token values for the active brand. Switch brands in the sidebar.

{darkEntries.map(([name, hex]) => (
{name}
{hex}
))}
{lightEntries.map(([name, hex]) => (
{name}
{hex}
))}
{`heading: ${brand.typography.heading}\nbody: ${brand.typography.body}\nmono: ${brand.typography.mono}`}

Heading 1

Heading 2

Heading 3

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}`}
{[ { name: '--space-1', value: '0.25rem (4px)', width: '1.5rem' }, { name: '--space-2', value: '0.5rem (8px)', width: '3rem' }, { name: '--space-3', value: '0.75rem (12px)', width: '4.5rem' }, { name: '--space-4', value: '1rem (16px)', width: '6rem' }, { name: '--space-6', value: '1.5rem (24px)', width: '9rem' }, { name: '--space-8', value: '2rem (32px)', width: '12rem' }, ].map(sp => (
{sp.name}: {sp.value}
))}
{`/* 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};`}
); }