flex gap-4 p-2 bg-slate-900 text-white. Each class does one thing. Combine them for any design.npm install -D tailwindcss @tailwindcss/vite
Configure and add to main CSS:
@import "tailwindcss";
// Before (plain CSS):
<nav className="toolbar">
<button className="tool-btn active">
Upload
</button>
</nav>
// After (Tailwind):
<nav className="flex flex-col items-center
gap-1 bg-slate-900 p-2 w-14">
<button className="w-10 h-10 rounded-lg
bg-slate-800 hover:bg-slate-700
text-slate-200 text-xs border border-slate-700
hover:border-cyan-500 transition-colors">
Upload
</button>
</nav>
Convert from plain CSS to Tailwind:
| Component | Key Utilities |
|---|---|
| Toolbar | flex, flex-col, gap-1, bg-slate-900 |
| ToolButton | w-10, h-10, rounded-lg, hover:bg-slate-700 |
| FilterSlider | flex, items-center, gap-2, text-sm |
| SettingsPanel | flex, flex-col, gap-3, p-4, overflow-y-auto |
| Toast | fixed, bottom-4, right-4, rounded-md, shadow-lg |
Use responsive classes for mobile-first layout:
<div className="flex flex-col md:flex-row">
{/* Stacked on mobile, side-by-side on desktop */}
</div>
Extract repeated patterns into component props rather than CSS classes. The component itself is the reusable unit — not the class name.
Compare: development speed with Tailwind vs writing custom CSS.
git switch -c refactor/PIXELCRAFT-033-tailwind
git add src/ tailwind.config.js
git commit -m "Migrate 5 components to Tailwind CSS (PIXELCRAFT-033)"
git push origin refactor/PIXELCRAFT-033-tailwind
# PR → Review → Merge → Close ticket ✅
Convention over configuration.
Tailwind provides a fixed set of design tokens. By constraining choices, it speeds up development and enforces consistency.