Module 7 — Tailwind Theming
5 lessons · Styling · Phlex::UI + KanbanFlow
We introduce CSS design tokens via Tailwind v4’s@themedirective, restyle the entirePhlex::UIlibrary with semantic colour variables, add dark mode, and implement multi-theme support — all without touching a single component file.
Before we start
Right now Phlex::UI components use raw Tailwind palette values:
|
|
These work, but they’re fragile. Changing the primary colour means hunting through every component file. There’s no single source of truth for the design system. Adding dark mode means duplicating every colour decision.
By the end of this module, Button’s primary variant looks like this:
|
|
Changing the primary colour is a one-line change in application.css.
Dark mode is automatic. A second theme is a handful of CSS lines.
No component files touched for any of it.