Sources: Context7Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
/tailwindlabs/tailwindcss.com, /dcastil/tailwind-merge.Use: Embed as “Research Brief” in PF-77 spec.
STATUS: MIGRATION COMPLETE (2026-04-01). This document was the pre-migration research brief for PF-77. The migration has been executed successfully. For the current post-migration state, seeCLAUDE.md(tech stack) andsrc/index.css(theme configuration). The information below is retained as historical context.
Official upgrade path and prerequisites
- Node.js 20+ required for
@tailwindcss/upgrade. - Single migration: Upgrade Tailwind CSS v3 → v4 and tailwind-merge v2 → v3 together. tailwind-merge v3 supports only Tailwind v4; do not upgrade tailwind-merge v3 while staying on Tailwind v3. (Ref: tailwind-merge v2-to-v3 migration.)
- Official tool:
npx @tailwindcss/upgrade
Automates dependency updates, config migration, and template changes. (Ref: Tailwind upgrade guide.)
Confirmed breaking and config changes
| Area | v3 | v4 |
|---|---|---|
| CSS entry | @tailwind base; @tailwind components; @tailwind utilities; | @import "tailwindcss"; |
| Config | tailwind.config.ts (JS/TS) | CSS-first: @theme { ... } in CSS; config file may be migrated or replaced by upgrade tool. |
| PostCSS | tailwindcss, autoprefixer (often) | @tailwindcss/postcss only (autoprefixer integrated). |
| Vite | PostCSS pipeline | Optional @tailwindcss/vite plugin; can use PostCSS instead. |
| Dark mode | darkMode: 'class' in config | v4 default is prefers-color-scheme; must re-enable class-based dark if used. |
| Arbitrary CSS variables | [--variable-name] | (--variable-name) (parentheses). (Ref: upgrade-guide.) |
| tailwind-merge | v2 with prefix e.g. tw- | v3: prefix without combining character (e.g. tw not tw-). |
Required tools and workflow
- Run upgrade tool:
npx @tailwindcss/upgrade
(Node 20+; run from project root.) - PostCSS (if not using Vite plugin):
Replacetailwindcssandautoprefixerwith:
"@tailwindcss/postcss": {}
inpostcss.config.js. - Vite alternative:
Installtailwindcssand@tailwindcss/vite; invite.config.tsaddtailwindcss()to plugins; in main CSS use@import "tailwindcss";. - Theme/customization:
Move custom theme (colors, fonts, breakpoints, spacing, shadows, keyframes) into@theme { ... }in CSS; extend or override as per Tailwind v4 docs. - tailwind-merge:
Bump to v3; if usingextendTailwindMerge/createTailwindMergewith a prefix, remove the combining character (e.g.tw-→tw).
Repo compatibility notes
- Config:
tailwind.config.tsusesdarkMode: ['class'], largetheme.extend, andtailwindcss-animate. After upgrade, re-assert class-based dark (darkMode: ['class']) and migrate theme to@themewhere applicable. - Plugin (tailwindcss-animate): Either (1) keep tailwindcss-animate v1.0.7 with Tailwind v4 by loading the JS plugin via the
@configdirective—keep the plugin entry intailwind.config.tsand reference it from your main CSS with@configso the plugin is applied, or (2) migrate to a CSS-first animation solution such as tw-animate-css or @iscodex/tailwindcss-animate: remove the tailwindcss-animate plugin fromtailwind.config.ts, add the new package, and update your CSS imports to use the new package’s styles. Verify the chosen plugin version is compatible with Tailwind v4 before deployment. - CSS entry:
src/index.cssuses@tailwind base/components/utilitiesand@layer+@apply. These need to align with v4 CSS-first approach; upgrade tool may rewrite. - Utilities:
src/shared/lib/utils.tsusescn()withtwMerge(clsx(inputs))and no customextendTailwindMerge; bumping tailwind-merge to v3 is sufficient unless a custom prefix is added later. - Arbitrary values / theme():
src/shared/ui/sidebar.tsxusestheme(spacing.4)insidecalc(). In Tailwind v4, replace with the v4 theme variable form, e.g.calc(var(--spacing-4) - 1px)orcalc(--spacing(4) - 1px)(syntax per v4 docs). Update any helper or style string that builds that calc expression accordingly, and verify tailwindcss-animate (or replacement) is v4-compatible before deployment.
Recommended rollout and rollback
- Branch: Create a dedicated migration branch (or tag a commit) that captures the pre-migration state of
tailwind.config.ts,postcss.config.js(if present), andsrc/index.css. Prefer version control over copying files intodocs/development/backups/so rollbacks are tracked and the docs folder stays uncluttered. - Run:
npx @tailwindcss/upgrade; resolve conflicts; restore class dark mode and custom theme in@theme/config as needed. - Bump: Ensure
tailwindcss4.x andtailwind-merge3.x in package.json;npm install. - Manual pass: Replace any
[--var]with(--var); fix theme() usage if changed; run build and visual pass. - Validate:
npm run validate;npm run test:baseline; visual regression on shared UI and key flows. - Rollback: Revert the migration branch or restore from the pre-migration tag/commit;
npm installand re-validate.