@ringer-tel/tokens
v0.3.1
Published
Ringer design tokens — CSS variables, fonts, logo assets. Framework-agnostic.
Readme
@ringer-tel/tokens
Design tokens for the Ringer unified aesthetic. CSS variables, font @imports, density utilities, and the canonical 8-file logo set.
Usage
@import '@ringer-tel/tokens/fonts.css';
@import '@ringer-tel/tokens/tokens.css';
@import '@ringer-tel/tokens/density.css';
@import '@ringer-tel/tokens/editorial.css'; /* optional — `.text-eyebrow`, `.text-display-{lg,md}` */To prevent FOUC on theme resolution, inline theme-resolve.ts into your document head as the very first script.
Theme selector
Dark mode is keyed on a data-theme="dark" attribute on <html> (set by theme-resolve.ts). The tailwind preset's darkMode is configured as ['class', '[data-theme="dark"]'] so a legacy class="dark" toggle ALSO works, but data-theme="dark" is the canonical mechanism going forward. Don't mix the two on the same surface.
What it ships
fonts.css— Kumbh Sans (Google Fonts import) + IBM Plex Mono.tokens.css— light + dark CSS variables (--ringer-*, semantic--primary,--surface,--card,--muted,--popover,--input,--secondary, etc.). v0.1.2 added the shadcn-canonical surface aliases (card/muted/popover/input/secondary+ foregrounds) sobg-card,bg-muted, etc. Just Work.density.css—.density-portal/.density-marketingclass helpers.editorial.css—.text-eyebrowand.text-display-{lg,md}editorial utility classes (optional import).theme-resolve.ts— synchronous theme resolver to setdata-themebefore first paint.logo/— 8 brand logo files (4 variants × 2 formats). Seelogo/README.md.
HSL-channel vars (v0.3.0)
Every flat-color semantic var ships a parallel -hsl sibling:
--foreground: var(--ringer-black); /* #231F20 — raw color, valid in `color:` rules */
--foreground-hsl: 345 6.1% 12.9%; /* HSL channels, for Tailwind slash-opacity */The @ringer-tel/tailwind-preset colors map references the -hsl siblings via hsl(var(--{name}-hsl) / <alpha-value>), so bg-foreground/75, bg-ringer-aqua/10, etc. compose at the expected alpha. Consumers reading the unsuffixed vars directly (e.g. style={{ color: 'var(--foreground)' }}, inline SVG fills) continue to see the canonical hex value — the -hsl form is for the Tailwind pipeline only.
