Skip to content

feat(frontend): migrate to Tailwind CSS v4 (#852, supersedes #686)#858

Merged
hellodk merged 4 commits into
masterfrom
feat/tailwind-v4-migration
Jun 24, 2026
Merged

feat(frontend): migrate to Tailwind CSS v4 (#852, supersedes #686)#858
hellodk merged 4 commits into
masterfrom
feat/tailwind-v4-migration

Conversation

@hellodk

@hellodk hellodk commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrades tailwindcss from v3.4.x to v4.3.1 and replaces the PostCSS plugin with the dedicated @tailwindcss/vite Vite plugin for better DX and faster builds
  • Removes autoprefixer and postcss dev-dependencies (v4 handles vendor prefixing automatically)
  • Migrates the JS config (tailwind.config.js) to a CSS-first @theme {} block inside src/index.css, preserving the full brand color palette
  • Renames all deprecated/renamed utility classes across the entire frontend/src/ tree per the official v4 upgrade guide

Plugin approach

@tailwindcss/vite — the Vite-native plugin. This is the recommended approach for Vite projects; it integrates directly into Vite's transform pipeline and requires no PostCSS configuration.

Theme approach

CSS-first @theme {} — the brand color tokens are now declared as CSS custom properties directly in src/index.css:

@import "tailwindcss";

@theme {
  --color-brand-50: #f0f4ff;
  /* … */
  --color-brand-950: #1f2064;
}

Utility classes renamed

v3 class v4 class Count
shadow-sm shadow-xs 106
outline-none outline-hidden 114
flex-shrink-0 shrink-0 114

Verification

  • pnpm build (tsc -b && vite build): passed — 71 KB CSS bundle generated
  • pnpm lint: passed — 0 errors, 2 pre-existing warnings (unrelated to this PR)
  • pnpm test: passed — 5/5 tests

Closes #852

Made with Cursor

Switch from Tailwind v3 + PostCSS plugin to Tailwind v4 with the
dedicated Vite plugin (@tailwindcss/vite). Remove autoprefixer and
postcss since v4 handles both automatically.

Config changes:
- vite.config.ts: add @tailwindcss/vite plugin
- postcss.config.js: emptied (no longer needed)
- tailwind.config.js: deleted; theme migrated to CSS-first @theme {}
  block in src/index.css with the brand color palette

CSS entry:
- src/index.css: replace @tailwind directives with @import "tailwindcss"
  and inline @theme { --color-brand-* } tokens

Utility class renames per the v4 upgrade guide:
- shadow-sm  → shadow-xs  (106 occurrences)
- outline-none → outline-hidden  (114 occurrences, preserves
  forced-colors accessibility behaviour)
- flex-shrink-0 → shrink-0  (114 occurrences)

Closes #852
@github-actions github-actions Bot added the frontend Frontend / React changes label Jun 23, 2026
@github-actions

Copy link
Copy Markdown

Coverage Report

85.5% on fleet_platform/services/ (gate: 80%)

Gate passed

@github-actions

Copy link
Copy Markdown

Coverage Report

85.5% on fleet_platform/services/ (gate: 80%)

Gate passed

@github-actions

Copy link
Copy Markdown

Coverage Report

85.9% on fleet_platform/services/ (gate: 80%)

Gate passed

@github-actions

Copy link
Copy Markdown

Coverage Report

85.9% on fleet_platform/services/ (gate: 80%)

Gate passed

@hellodk
hellodk merged commit 5c4c763 into master Jun 24, 2026
12 checks passed
@hellodk
hellodk deleted the feat/tailwind-v4-migration branch June 25, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend / React changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate frontend to Tailwind CSS v4 (supersedes Dependabot #686)

1 participant