Tailwind Architect (VSCode / Cursor Extension)Analyze and fix Tailwind CSS classes directly in your editor: sort utilities, remove redundancy, detect conflicts, and apply optimization suggestions. Part of the Tailwind Architect toolchain. Use this extension in VS Code or Cursor; use the CLI for CI and batch fixes. Features
InstallationFrom the Marketplace
Works in VS Code and Cursor. From a VSIX file (local build)
Requirements
The extension uses your workspace root to resolve config and Tailwind. A single-root folder is recommended. UsageCommands (Command Palette:
|
| Command | Description |
|---|---|
| Tailwind Architect: Fix Classes | Fix the currently active file (sort, remove redundant, apply suggestions). |
| Tailwind Architect: Fix Workspace | Fix all supported files in the workspace. Shows progress and a summary. |
Code actions (Quick fix)
In supported files, when the extension reports issues, use the lightbulb or Quick Fix (Ctrl+. / Cmd+.) and choose Tailwind Architect: Fix Classes.
Settings
Open Settings (Ctrl+, / Cmd+,) and search for Tailwind Architect.
| Setting | Type | Default | Description |
|---|---|---|---|
| Tailwind Architect: Format On Save | boolean |
false |
Run the fix when you save a supported file. |
| Tailwind Architect: Diagnostics At Span Level | boolean |
false |
Show one diagnostic per class string (with range) instead of one per file. Useful for large files. |
Supported languages and files
- JavaScript / TypeScript —
.js,.jsx,.ts,.tsx,.mjs,.cjs - Vue —
.vue(templateclassattributes) - Astro —
.astro - Svelte —
.svelte
Class strings are read from:
- JSX/TSX:
className,class, and inside helpers likeclsx,cn,cva,tw(configurable intailwind-architect.config.json). - Vue/Astro/Svelte:
class="..."(andclass='...') in templates.
Configuration
Optional: add tailwind-architect.config.json at your workspace root (same level as package.json or tailwind.config.js).
{
"sortClasses": true,
"removeRedundant": true,
"detectConflicts": true,
"readabilityMode": false,
"autoFix": true,
"classFunctions": ["clsx", "cn", "cva", "tw"],
"plugins": []
}
- sortClasses — Apply semantic sort order.
- removeRedundant — Remove overridden/redundant utilities.
- detectConflicts — Report conflicting utilities.
- readabilityMode — Break long class lists across lines.
- classFunctions — Function names whose arguments are treated as class strings.
- plugins — Optional list of Tailwind Architect plugin package names.
If the file is missing, the extension uses the defaults above.
Compatibility
- Tailwind v3 and v4 — The extension uses the same engine as the CLI; it discovers
tailwind.config.*and respects your prefix/theme when available. CSS-only setups (e.g. v4 with only@configin CSS) still work with default behavior. - VS Code —
^1.74.0. - Cursor — Compatible with the same API.
Troubleshooting
No diagnostics or fix doesn’t run
Ensure the current file’s language or extension is supported, and that the folder you opened is the workspace root (or contains yourtailwind-architect.config.jsonand Tailwind setup).“No workspace folder open”
Open a folder (File → Open Folder) so the extension can resolve the root and config.Fix Workspace is slow
The extension runs the same logic as the CLI over many files. For very large workspaces, consider using the CLI with--max-workersin a terminal instead.Wrong or missing Tailwind prefix
Ensuretailwind.config.*is present and that the extension can load it (e.g. no runtime errors in the config). The extension resolves config from the workspace root.
Links
- Repository: tailwind-architect
- CLI (npm): tailwind-architect
- Docs: Guide (or
website/in the repo) - Core API: @tailwind-architect/core
License
MIT. See the project license in the main repository.