@ringer-tel/tailwind-preset
v0.3.1
Published
Tailwind 3.4 preset for the Ringer aesthetic. Consumes @ringer-tel/tokens.
Readme
@ringer-tel/tailwind-preset
Tailwind 3.4 preset for the Ringer unified aesthetic. Maps @ringer-tel/tokens CSS variables to Tailwind utilities so bg-primary, text-foreground, shadow-popover, rounded-DEFAULT etc. resolve to the brand-correct values.
Install
pnpm add -D @ringer-tel/tailwind-preset @ringer-tel/tokens tailwindcss// tailwind.config.ts
import type { Config } from 'tailwindcss';
import { ringerPreset } from '@ringer-tel/tailwind-preset';
export default {
presets: [ringerPreset],
content: ['./src/**/*.{ts,tsx,html}'],
} satisfies Config;Import the tokens CSS at app entry so the CSS variables exist at runtime:
/* src/index.css */
@import '@ringer-tel/tokens/fonts.css';
@import '@ringer-tel/tokens/tokens.css';
@import '@ringer-tel/tokens/density.css';
@tailwind base;
@tailwind components;
@tailwind utilities;What it exposes
| Category | Utilities | Notes |
|---|---|---|
| Colors | bg-primary, text-foreground, bg-card, bg-muted, bg-popover, bg-sidebar, bg-ringer-aqua, bg-ringer-tangerine, bg-ringer-cream, bg-ringer-black, bg-ringer-darqua, border-border, etc. | All map to @ringer-tel/tokens HSL-channel CSS vars (hsl(var(--{name}-hsl) / <alpha-value>)), so slash-opacity utilities like bg-foreground/75 and bg-ringer-aqua/10 compose correctly. shadcn-canonical aliases (card/muted/popover/input/secondary + foregrounds) are included. |
| Border radius | rounded-DEFAULT (6px), rounded-pill | One radius across the system per spec §3.5. |
| Box shadow | shadow-popover, shadow-dialog, shadow-none | Warm-black-tinted (rgba(35, 31, 32, …)) — not stock Tailwind black. See "Elevated card recipe" below. |
| Typography | font-sans (Kumbh Sans → Arial fallback), font-mono (IBM Plex Mono), font weights, letter spacings | |
| Motion | duration-fast/base/slow, ease curve | Maps to --dur-* + --ease tokens. |
| Ring | ring-DEFAULT | 2px aqua focus ring at 60% opacity, offset 2px. |
| Dark mode | darkMode: ['class', '[data-theme="dark"]'] | The data-theme="dark" attribute on <html> is canonical; legacy class="dark" also works. |
Elevated card recipe
Per spec §5.6, three surface tiers:
| Tier | Use | Recipe |
|---|---|---|
| Surface (default) | data cards, list rows | <Card> (no shadow) |
| Elevated | popovers, tooltips, auth/login cards, marketing CTA cards | <Card className="shadow-popover"> |
| Dialog | modals, sheets | <Card className="shadow-dialog"> |
The 6px radius is locked across all tiers — elevation is the shadow channel only. The shadow-popover value is warm-black-tinted so the elevation feels Ringer-native rather than off-the-shelf SaaS; stock Tailwind shadow-lg is pure-black and shouldn't be used on Ringer auth or marketing surfaces.
- <Card className="w-full border-border shadow-lg"> // stock Tailwind, do NOT
+ <Card className="w-full border-border shadow-popover"> // canonical Ringer elevatedVersioning
Versioned in lockstep with @ringer-tel/tokens and @ringer-tel/ui. Consumers should pin all three at the same major.minor.
Source + spec
- Source:
Ringer/aesthetic-rewrite - Design spec (canonical):
docs/superpowers/specs/2026-05-12-ringer-unified-aesthetic-design.md
