A comprehensive Zed extension that enhances TailwindCSS support across all frontend frameworks including Next.js, Nuxt.js, Vue, Svelte, Astro, and more.
- 🚀 Enhanced Language Server: Advanced TailwindCSS language server configuration
- 🎯 Multi-Framework Support: Works with React, Vue, Svelte, Astro, Angular, and more
- 📝 Rich Snippets: 25+ pre-built TailwindCSS snippets for common patterns
- 🔧 Smart Configuration: Automatic detection and configuration for different project types
- 🎨 Advanced Class Detection: Support for styled-components, emotion, and other CSS-in-JS solutions
- 🌙 Dark Mode Ready: Built-in support for dark mode classes
- ⚡ Performance Optimized: WebAssembly-based extension for maximum performance
- React/Next.js:
.jsx,.tsx,.js,.ts - Vue/Nuxt.js:
.vue,.js,.ts - Svelte/SvelteKit:
.svelte,.js,.ts - Astro:
.astro,.jsx,.tsx - Angular:
.html,.ts,.component.html - Laravel/Blade:
.php,.blade.php - Ruby on Rails:
.erb,.html.erb - Phoenix/LiveView:
.heex,.eex - Standard Web:
.html,.css,.scss,.sass - Markdown:
.md,.mdx
- Open Zed
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Linux/Windows) - Type "Extensions" and select "Extensions: Open Extensions"
- Search for "TailwindCSS Enhanced"
- Click "Install"
-
Clone this repository:
git clone https://github.com/yourusername/zed-tailwindcss.git cd zed-tailwindcss -
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Add WebAssembly target:
rustup target add wasm32-wasip1
-
Build the extension:
cargo build --target wasm32-wasip1 --release
Or use the build script:
./build.sh
-
Install as dev extension in Zed:
- Open Zed
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Linux/Windows) - Type "Install Dev Extension" and select it
- Navigate to and select this directory
The extension automatically detects your project type and applies appropriate configurations.. No manual setup required!
Type any of these prefixes and press Tab to expand:
tw-flex-center→flex items-center justify-centertw-grid-center→grid place-items-centertw-abs-center→ Absolute positioning centertw-full→w-full h-full
tw-btn-primary→ Primary button stylingtw-btn-secondary→ Secondary button stylingtw-card→ Basic card componenttw-input→ Styled input fieldtw-badge→ Badge componenttw-navbar→ Navigation bartw-modal-overlay→ Modal overlay
tw-hover-transition→ Smooth hover transitiontw-shadow-hover→ Shadow effect on hovertw-spinner→ Loading spinner animationtw-gradient→ Gradient background
tw-container→ Responsive containertw-text-responsive→ Responsive text sizingtw-grid-layout→ Responsive grid layouttw-padding-responsive→ Responsive padding
tw-alert-success→ Success alert stylingtw-alert-error→ Error alert stylingtw-focus→ Focus ring stylingtw-dark→ Dark mode classes
The extension automatically detects and provides IntelliSense for:
// Template literals
const Button = tw`bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded`;
// Styled-components
const StyledButton = styled.button`
${tw`bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded`}
`;
// Emotion
const buttonStyles = css`
${tw`bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded`}
`;
// Class variance authority (CVA)
const button = cva("px-4 py-2 rounded", {
variants: {
intent: {
primary: "bg-blue-500 text-white",
secondary: "bg-gray-200 text-gray-900",
},
},
});The extension recognizes framework-specific class attributes:
- React:
className - Vue:
:class,v-bind:class - Angular:
ngClass - Astro:
class:list
Add these to your Zed settings.json for additional customization:
{
"lsp": {
"tailwindcss-language-server": {
"settings": {
"tailwindCSS": {
"classAttributes": ["class", "className", "ngClass", "class:list"],
"experimental": {
"classRegex": [
"tw`([^`]*)",
"tw=\"([^\"]*)",
"tw={\"([^\"}]*)",
"classNames\\s*\\(\\s*['\"`]([^'\"`]*)['\"`]",
"cva\\s*\\([^)]*['\"`]([^'\"`]*)['\"`]"
]
},
"emmetCompletions": false,
"validate": true,
"lint": {
"cssConflict": "warning",
"invalidApply": "error",
"invalidScreen": "error",
"invalidVariant": "error",
"invalidConfigPath": "error",
"invalidTailwindDirective": "error",
"recommendedVariantOrder": "warning"
},
"hovers": true,
"suggestions": true,
"codeActions": true,
"colorDecorators": true
}
}
}
}
}The extension looks for and respects your project's TailwindCSS configuration files:
tailwind.config.jstailwind.config.tstailwind.config.cjstailwind.config.mjs
- Ensure you have Node.js installed (version 14 or later)
- Check Zed's log:
View → Developer → Open Logs - Restart Zed with verbose logging:
zed --foreground
- Verify your project has a
tailwind.config.jsfile - Check that TailwindCSS is installed in your project:
npm list tailwindcss
- Make sure your file type is supported (see list above)
Add your custom patterns to the experimental.classRegex array in your Zed settings (see Configuration section above).
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test them
- Build the extension:
cargo build --target wasm32-wasi --release - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Zed Editor: Latest version
- Rust: 1.70+ (for development)
- Node.js: 16+ (for TailwindCSS language server)
- TailwindCSS: Any version (in your project)
If you don't have the TailwindCSS language server installed globally, you can install it:
npm install -g @tailwindcss/language-serverOr using your project's package manager:
# npm
npm install -D @tailwindcss/language-server
# yarn
yarn add -D @tailwindcss/language-server
# pnpm
pnpm add -D @tailwindcss/language-serverThis project is licensed under the MIT License - see the LICENSE file for details.
- Install the extension (see Installation section above)
- Copy example settings: Use the provided
example-zed-settings.jsonas a starting point for your Zed configuration - Install TailwindCSS language server globally or in your project
- Create/verify your TailwindCSS config in your project root
- Start coding with enhanced TailwindCSS support!
- Initial release
- Enhanced language server configuration
- Multi-framework support
- 25+ TailwindCSS snippets
- CSS-in-JS support
- Framework-specific attribute recognition
- WebAssembly-based extension for performance
- Build script for easy development
If you encounter any issues or have suggestions:
- Check the troubleshooting section
- Search existing GitHub Issues
- Create a new issue with:
- Your Zed version
- Your operating system
- Steps to reproduce the issue
- Relevant log output
- TailwindLabs for the amazing TailwindCSS framework and language server
- Zed Industries for the fast and extensible editor
- The Zed community for feedback and contributions..