Skip to main content

Feature deep-dive · SaaSForge Starter

Tailwind v4 starter for Next.js 16 with oklch theme tokens

Tailwind v4 starter for Next.js 16 with oklch theme tokens

Tailwind v4 changed enough about how Tailwind is configured that a 'v4 starter' is not just a v3 starter with a version bump. The config moved into CSS, the engine is faster, and color tokens can use modern color spaces like oklch without polyfills. A boilerplate that is actually built around v4 looks structurally different from one that survived an upgrade.

Why oklch instead of hex or HSL

oklch is a perceptually uniform color space: a 10% lightness shift in oklch looks like a 10% lightness shift to the human eye. Hex and HSL do not have that property, the same numeric step can look subtly different across hues, which is why hand-tuned palettes often feel inconsistent.

BoilerlyKit's Starter, AI, and Core templates define every color token in oklch in `globals.css`. Light and dark palettes each get their own block. Every component reads from semantic tokens (`--primary`, `--muted`, `--destructive`) rather than from raw color values, so theming the whole site is a token edit, not a component-by-component refactor.

Semantic oklch tokens in globals.css
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --primary: oklch(0.65 0.18 250);
  --primary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --primary: oklch(0.72 0.18 250);
}

CSS-first config, what changed and what it means

In v3, the source of truth was `tailwind.config.ts`. In v4, the source of truth is your CSS, design tokens, breakpoints, and theme extensions live alongside the styles they describe. The boilerplates lean into this: `globals.css` is the file you edit to rebrand, not a TypeScript config plus a CSS file plus a theme provider.

The trade-off is that v3 plugins that expected the JS config API need a v4-shaped equivalent. BoilerlyKit's Starter, AI, and Core ship with the plugin set already updated; you do not have to debug v3-versus-v4 plugin compatibility yourself.

shadcn/ui on Tailwind v4

shadcn/ui is the component layer across all three v4 templates. The components are copied into the repo (not installed as a dependency), so they are yours to edit. The v4 versions of each component read from the oklch token set; if you change `--primary`, every shadcn button, badge, and focus ring updates.

Radix primitives underpin the interactive components (Dialog, Dropdown, Tooltip), that part is unchanged across v3 and v4. The Tailwind-specific work is in the class names and the theme bindings, not in the underlying primitives.

Why SaaSForge Agency is on v3 (and that is fine)

SaaSForge Agency is on Tailwind v3, not v4. The reason is operational: Directus's admin theming, plus the agency template's color-customizer flow for client white-labeling, integrates more cleanly against the v3 config layout. That is a deliberate decision documented in the repo, not an oversight.

If you want a Tailwind v4 marketing site for an agency, the cleanest path today is to start from Starter (v4) and add a CMS yourself, or use Agency on v3 and accept the version gap. Both options are honest; a v4 Agency upgrade is on the roadmap when the integration shape settles.

Frequently asked

Do I need to know Tailwind v4 specifics to use these templates?
No. The templates ship with a working setup; you can write Tailwind classes the way you always have. The v4 differences show up when you want to extend the theme, adding a new color, breakpoint, or font family, and the documentation covers the v4 CSS-first config in those spots.
Can I use a hex or HSL palette instead of oklch?
Yes. The token names (`--primary`, `--background`) do not care which color space you use; replace the oklch values with hex or HSL and everything works. You lose the perceptual-uniformity benefit but the rest of the system is unchanged.
Will Tailwind v4 break my favorite v3 plugin?
Some v3 plugins do not have v4 equivalents yet. The boilerplates only depend on plugins that ship v4 versions (typography, container queries) so you do not inherit an upgrade-stuck plugin from clone day. Adding your own v3-only plugin would be a compatibility check on you.
How does dark mode work on Tailwind v4?
Dark mode is a `.dark { }` block in CSS that overrides the oklch tokens, paired with next-themes for the class-on-html toggle. No JS theme provider object to maintain, the theme is data, not behavior. `class`-based dark mode rather than media-query-based is the default so users can override their system preference.
Ships in SaaSForge Starter

See SaaSForge Starter. Skip the deliberation.

Full source code. Lifetime updates. Polar Merchant-of-Record checkout. Private GitHub repo on purchase.