# @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

Heading

Body text

``` | Utility | Token | |---------|-------| | `bg-dt-bg`, `text-dt-bg` | `--color-bg` | | `bg-dt-surface` | `--color-surface` | | `bg-dt-primary`, `text-dt-primary` | `--color-primary` | | `bg-dt-secondary` | `--color-secondary` | | `bg-dt-accent` | `--color-accent` | | `bg-dt-error` | `--color-error` | | `text-dt-text-primary` | `--color-text-primary` | | `text-dt-text-secondary` | `--color-text-secondary` | | `text-dt-text-muted` | `--color-text-muted` | ### Mode Colors Card mode colors are available under the `mode-` prefix: ```html
Normal
Emphasis
Warning
``` ### Spacing ```html
...
``` | Utility | Token | |---------|-------| | `*-dt-1` through `*-dt-8` | `--space-1` through `--space-8` | ### Border Radius ```html
Default
Small
Large
``` ### Font Family ```html

Tektur heading

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
Cyan neon theme
Navy magenta theme
``` ## Monorepo Part of the [DT Design System](https://github.com/dangerous-tac0s/dt-design-system) monorepo. ## License [MIT](LICENSE)