BitSleuth uses Tailwind CSS 4 for styling, and the Tailwind CSS Language Server provides enhanced IDE features including:
- IntelliSense: Autocomplete for Tailwind CSS classes
- Linting: Warnings for unknown or deprecated classes
- Hover Previews: See the generated CSS on hover
- Color Decorators: Visual color indicators for color utilities
- Class Sorting: Automatic class ordering suggestions
The Tailwind CSS language server is included in the project's devDependencies and will be installed automatically when you run:
npm installThis ensures all developers use the same version (^0.14.29) and maintains consistency across the team.
If you prefer a global installation for use across multiple projects:
npm install -g @tailwindcss/language-serverNote: The VS Code extension will use the local version from node_modules if available, falling back to the global installation.
For the best experience in VS Code, install the official Tailwind CSS IntelliSense extension:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Tailwind CSS IntelliSense"
- Install the extension by Brad Lc
Alternatively, VS Code will prompt you to install recommended extensions when you open the repository.
The repository includes VS Code settings (.vscode/settings.json) pre-configured for Tailwind CSS:
- Class Regex: Configured to recognize Tailwind classes in
cva()andcn()utility functions - Include Languages: TypeScript and TSX support enabled
- Quick Suggestions: Enabled for strings to get autocomplete in className attributes
- Emmet Completions: Enabled for faster class writing
- CSS Validation: Disabled to prevent conflicts with Tailwind's utility-first approach
The project's Tailwind configuration is located at:
tailwind.config.ts- Main Tailwind configuration filepostcss.config.mjs- PostCSS configuration for Tailwind processing
Note: Tailwind CSS 4 uses a new PostCSS-based architecture. The project uses @tailwindcss/postcss (v4.1.18) instead of the traditional separate PostCSS plugins. This provides improved performance and better integration with Next.js.
The language server is configured to recognize Tailwind classes in:
-
Standard className attributes:
<div className="flex items-center justify-between">
-
Class Variance Authority (CVA):
const buttonVariants = cva("rounded-md font-medium", { variants: { variant: { default: "bg-primary text-white", } } })
-
CN utility function:
<div className={cn("base-class", condition && "conditional-class")}>
If autocomplete isn't showing:
- Verify extension is installed: Check that "Tailwind CSS IntelliSense" is active in VS Code
- Restart VS Code: Sometimes the language server needs a fresh start
- Check Tailwind config: Ensure
tailwind.config.tsis in the project root - Verify file type: Make sure you're editing a
.tsx,.ts,.jsx, or.jsfile
If specific classes aren't autocompleting:
- Check custom regex: The VS Code settings include custom regex patterns for
cva()andcn() - Verify Tailwind version: Ensure your Tailwind version matches the language server's expectations
- Clear cache: Try deleting
.nextfolder and rebuilding:npm run dev:clean
If you see language server errors:
-
Reinstall dependencies:
rm -rf node_modules package-lock.json npm install
-
Check VS Code output: View → Output → Select "Tailwind CSS Language Server" from dropdown
-
Verify Node.js version: Ensure you're using Node.js 20+
-
Tailwind v4 compatibility: The language server should automatically detect Tailwind CSS 4. If issues persist, ensure you have the latest version of the Tailwind CSS IntelliSense extension.
- Autocomplete reduces typos and speeds up class writing
- Hover previews eliminate the need to check documentation
- Linting catches invalid or deprecated classes
- Class sorting keeps code consistent
- IntelliSense helps discover available utilities
- Hover previews teach the underlying CSS
Built with ❤️ by BitSleuth