Editor Setup
Set up your editor with IntelliSense, linting, and other helpful features to maximize your productivity when working with Tailwind CSS.VS Code IntelliSense
The official Tailwind CSS IntelliSense extension for Visual Studio Code provides autocomplete, syntax highlighting, and linting.Installation
- Install the Tailwind CSS IntelliSense extension from the VS Code marketplace
- Reload VS Code
Features
The IntelliSense extension provides several powerful features:Autocomplete
Get intelligent suggestions for class names as you type:- All available utility classes
- Variant modifiers (hover:, focus:, md:, etc.)
- Custom classes from your configuration
- Color opacity modifiers
Hover Preview
Hover over any Tailwind class to see the CSS it generates:CSS Language Features
IntelliSense works in CSS files with@apply directives:
Linting
The extension provides real-time linting to catch errors:- Unknown class names
- Invalid variant combinations
- Deprecated utilities
- CSS conflicts
Linting helps you catch typos and ensures you’re using valid Tailwind utilities. Enable it in your VS Code settings.
Configuration
Customize the extension behavior in your VS Code settings:.vscode/settings.json
Language Support
IntelliSense works in multiple file types:- HTML
- JSX/TSX (React)
- Vue
- Svelte
- Angular templates
- PHP
- Twig
- ERB
.vscode/settings.json
Custom Class Regex
If you’re using Tailwind classes in non-standard ways (like with a CSS-in-JS library), configure custom regex patterns:.vscode/settings.json
JetBrains IDEs
For WebStorm, PhpStorm, and other JetBrains IDEs:Built-in Support
JetBrains IDEs have built-in Tailwind CSS support:- Ensure Tailwind CSS is installed in your project
- The IDE will automatically detect and enable Tailwind support
Features
- Class name completion
- CSS preview on hover
- Syntax highlighting
- Navigation to definitions
Configuration
Enable or configure Tailwind support:- Go to Settings/Preferences → Languages & Frameworks → Style Sheets → Tailwind CSS
- Check Enable Tailwind CSS support
- Configure any additional settings
Neovim
For Neovim users, set up Tailwind IntelliSense with the Language Server Protocol (LSP):Installation with nvim-lspconfig
init.lua
With LazyVim
Sublime Text
For Sublime Text users:- Install LSP via Package Control
- Install LSP-tailwindcss via Package Control
- Restart Sublime Text
Automatic Class Sorting
Keep your classes organized automatically with Prettier:Installation
Install the official Prettier plugin:Configuration
Add the plugin to your Prettier config:.prettierrc.js
package.json:
package.json
How It Works
The plugin automatically sorts your classes following Tailwind’s recommended order:Before
After
- Layout (display, position, etc.)
- Box model (width, height, margin, padding)
- Backgrounds and borders
- Typography
- Effects (shadows, opacity)
- Transforms and transitions
- Filters
Consistent class ordering improves code readability and makes it easier to work in teams.
ESLint Integration
For additional linting, integrate with ESLint:Installation
Terminal
Configuration
Add to your.eslintrc.js:
.eslintrc.js
VS Code Settings Recommendations
Optimal VS Code settings for Tailwind development:.vscode/settings.json
Workspace Recommendations
Create a.vscode/extensions.json file to recommend extensions to your team:
.vscode/extensions.json
Troubleshooting
IntelliSense Not Working
If IntelliSense isn’t working:- Verify Tailwind CSS is installed: Check that
tailwindcssis in yourpackage.jsondependencies - Reload VS Code: Press
Cmd/Ctrl + Shift + Pand run “Developer: Reload Window” - Check the extension is enabled: Look for “Tailwind CSS IntelliSense” in your extensions list
- Review the output panel: Check the “Tailwind CSS IntelliSense” output for errors
Autocomplete in JSX Strings
If autocomplete isn’t working in JSX string literals:.vscode/settings.json
Performance Issues
For large projects, optimize IntelliSense performance:.vscode/settings.json
Next Steps
Core Concepts
Learn about utility-first CSS and Tailwind’s philosophy
Customization
Customize your design system with theme configuration