Migrating to v3.1
v3.1 replaces the component-specific color tokens with a short set of semantic tokens and reworks every core component to the React Aria structure. Use the Tailgrids CLI to upgrade your project, or stay on v3.
1. Run migrate
Commit your work, then preview what it would do. --dry-run shows the plan and writes nothing:
npx @tailgrids/cli@latest migrate --dry-runRun it without the flag from the project root to apply the changes:
npx @tailgrids/cli@latest migratemigrate is a guided flow that scans your project, previews the plan, asks for confirmation before writing any files, and saves a tailgrids-migrate-report.md report in the project root.
During the flow, migrate prompts you for:
- Theme: replaces the v3 Tailgrids theme in your main stylesheet with v3.1
tailgrids.csswhile preserving your custom styles. - Compatibility stylesheet: optionally adds
tailgrids-v3.0-compat.css(recommended if customized, renamed, or removed components remain, or if anything is unresolved). - Coding agent: offers to hand off remaining follow-up work if a supported agent is installed (see below).
migrate updates your stylesheets automatically (no manual copy-pasting needed) and backs up each modified file to <name>.bak.
Flags
| Flag | Effect |
|---|---|
--dry-run | Show the plan and the answers it would use. Asks nothing and writes nothing, not even the report. |
--yes | Accept both confirmations and the recommended answer to every question. |
--css / --no-css | Answer the theme question: replace the theme, or leave the main stylesheet alone. |
--compat / --no-compat | Answer the compatibility stylesheet question. |
--agent <name> / --no-agent | Hand off to claude, codex, gemini or cursor-agent afterwards, or skip the offer. |
--verbose | List every item that needs attention and print the full diff. |
Hand the rest to an agent
Pass tailgrids-migrate-report.md and the agent prompt (which includes the full token mapping and resolution rules) to your coding agent—or let migrate launch a supported agent on your PATH after the summary.
2. The compatibility stylesheet
tailgrids-v3.0-compat.css maps the v3 token names onto the new tokens, so components you have not migrated yet keep rendering. migrate writes it next to your main stylesheet and imports it after the new tailgrids.css when you answer yes. It is temporary and is removed in the next minor release: delete the file and its import once nothing references the old tokens. See Global CSS Variables for both files.
3. Not upgrading? Stay on v3
The v3 branch is preserved. Existing 1.x versions of the CLI keep installing v3 components, and the docs and code for v3 stay available on the v3 branch of the repository.
