# @dangerousthings/tailwind-preset Tailwind CSS v3 preset that maps Dangerous Things design tokens to Tailwind theme values. Uses CSS custom property references so the same utility classes work across both DT and Classic brands at runtime. ## Install ```bash npm install @dangerousthings/tailwind-preset ``` ### Peer Dependencies ```bash npm install tailwindcss@^3.4 ``` You also need a brand token CSS file loaded (from `@dangerousthings/web` or `@dangerousthings/tokens`). ## Setup Add the preset to your `tailwind.config.js`: ```js import dtPreset from "@dangerousthings/tailwind-preset"; export default { presets: [dtPreset], content: ["./src/**/*.{tsx,ts,html}"], }; ``` ## Available Utilities ### Colors All DT design token colors are available under the `dt-` prefix. Colors with `-rgb` variants support Tailwind opacity modifiers. ```html
Body text
Body text
Monospace
```
## Brand Switching
Because the preset uses `var()` references, switching brands at runtime requires only changing the CSS custom properties (e.g., via `data-brand` attribute). No Tailwind rebuild is needed.
```html