Skip to content

Tailwind CSS ​

This guide covers Tailwind CSS in a ream application:

  • Install
  • Wire it into Vite
  • Import Tailwind in your CSS entry
  • Merging classes — cn
  • About @c9up/tailwind
  • Without Vite

Tailwind is not shipped as a Ream package. You wire it into your project through Vite — Photon already owns the Vite stack, so the integration is two steps.

Install ​

sh
pnpm add -D tailwindcss @tailwindcss/vite

Wire it into Vite ​

Add @tailwindcss/vite to the plugins[] of your vite.config.ts:

typescript
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
  plugins: [
    tailwindcss(),
    // ...your Photon / framework plugins
  ],
})

Import Tailwind in your CSS entry ​

css
/* resources/css/app.css */
@import "tailwindcss";

That's it. No framework configuration command, no plugin to register on the Ream side. The Tailwind dev server picks up class usage from your TSX/JSX/HTML automatically.

Reference: Tailwind CSS — Install with Vite.

Merging classes — cn ​

For conditional class composition with conflict resolution (the clsx + tailwind-merge pattern), Aurora ships a zero-dependency cn built for Tailwind v4 — no extra packages to install:

ts
import { cn } from '@c9up/aurora'

cn('px-2', 'px-4')            // → 'px-4'  (later wins; dedup is the point)
cn('rounded-lg border', props.class)

Full details: Aurora → Tailwind classes (cn).

About @c9up/tailwind ​

A @c9up/tailwind stub package used to live in the workspace; it scaffolded tailwind.config.ts + postcss.config.js + an app.css entry via ream configure @c9up/tailwind. It was never published to npm, was retired and its workspace folder deleted on 2026-05-01. There is no replacement Ream package — the recipe above is the canonical Tailwind-in-Ream setup.

Reasoning: @tailwindcss/vite does the work and Photon already covers the Vite side. A framework-owned stub adds no value over the recipe above.

Without Vite ​

An app using the Tailwind CLI rather than the Vite plugin declares the watcher in reamrc.ts instead, and ream dev runs it alongside the server:

ts
export default {
  assets: {
    devServer: { command: 'pnpm', args: ['css:watch'] },
    build: { command: 'pnpm', args: ['css'] },
  },
}

See ream-cli → Assets. No concurrently needed: stopping the server stops the watcher. Plain --watch is enough — the watcher's stdin stays open for as long as ream dev runs, so it does not need --watch=always.