Skip to content

Add Tailwind CSS language server to CSS language settings - #39517

Closed
jsparkdev wants to merge 1 commit into
zed-industries:mainfrom
jsparkdev:css-tailwind-lang-server
Closed

Add Tailwind CSS language server to CSS language settings#39517
jsparkdev wants to merge 1 commit into
zed-industries:mainfrom
jsparkdev:css-tailwind-lang-server

Conversation

@jsparkdev

Copy link
Copy Markdown
Contributor

Although Zed offers native support for Tailwind CSS, users may encounter syntax warnings for custom at-rules and directives (e.g., @apply, @tailwind) if no language server is explicitly configured, as detailed in the official guide.

This pull request addresses this by adding the Tailwind CSS Language Server to the default configuration. This ensures a smooth, warning-free editing experience for Tailwind CSS stylesheets right out of the box, requiring zero configuration from the developer.

Before

image

After

image

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Oct 4, 2025
@danilo-leal

Copy link
Copy Markdown
Member

Hey, @jsparkdev thanks for the PR! I've been chatting with @thecrypticace from the Tailwind team and there's a possibility this could be fixed on the Tailwind LSP itself. Let's wait for an update from Jordan before moving forward with this (I do want to have it fixed, though. I've been seeing these same warnings for a while now, so thanks for jumping into it!).

@jsparkdev

Copy link
Copy Markdown
Contributor Author

@danilo-leal

Got it. Thank you for letting me know!

@thecrypticace

thecrypticace commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

It's not that we'd "fix" it in the Tailwind CSS language server — Zed would still require changes but this one is not sufficient as it doesn't provide general CSS completions at all.

We've only recently published our fork of VSCode's CSS language server in our @tailwindcss/language-server package in v0.14.27 two days ago. This is what our VSCode extension has used for years. You can see the PR for that here.

I think the best course of action would be to match our VSCode extension behavior:

  1. Add a second "Tailwind CSS" language that works just like "CSS".
  2. It should use the normal tailwindcss-language-server binary from @tailwindcss/language-server.
  3. It should also load the css-language-server binary from @tailwindcss/language-server instead of vscode-css-language-server (== using our fork instead of the default).

The LSP language ID of the new language is tailwindcss.

These could probably be integrated into the one language server binary but they've historically been separate and, for VSCode, the second one is booted on demand when you first open a CSS file in the "Tailwind CSS" language.

@thecrypticace

Copy link
Copy Markdown
Contributor

To fix the warnings in the short term you can override the vscode-css-language-server to point at a different binary in your Zed settings (this is what I do currently):

"lsp": {
  "vscode-css-language-server": {
    "binary": {
      "path": "/Users/jordanpittman/Library/Caches/fnm_multishells/57219_1755626184882/bin/node",
      "arguments": [
        "/Users/jordanpittman/Library/Application Support/Zed/languages/tailwindcss-language-server/node_modules/.bin/css-language-server",
        "--stdio"
      ]
    }
  }
}

You'll want to update path to point to wherever you have Node.js installed and then the first argument path will be different based on your user name (on macOS at least). I'm not sure what the path is for users testing on Windows.

@jgabriel98

Copy link
Copy Markdown

hey guys! any progress on this?
@danilo-leal did the tailwind team gave an answer yet?

Just checking by, to better set my expectations
(tailwind not properly working is the only think holding me back from vscode to zed)

@jsparkdev jsparkdev closed this by deleting the head repository Dec 29, 2025
gaauwe added a commit that referenced this pull request Jan 5, 2026
Closes #44904

Adds the Tailwind CSS LSP as suggested here:
#39517 (comment).
This allows users to use the Tailwind CSS LSP for CSS files, to support
Tailwind specific rules.

Docs will be added in a separate PR after this is released

Release Notes:

- Add Tailwind CSS Mode support, for Tailwind specific CSS rules like
`@apply`, `@layer`, and `@theme`.
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
Closes #44904

Adds the Tailwind CSS LSP as suggested here:
#39517 (comment).
This allows users to use the Tailwind CSS LSP for CSS files, to support
Tailwind specific rules.

Docs will be added in a separate PR after this is released

Release Notes:

- Add Tailwind CSS Mode support, for Tailwind specific CSS rules like
`@apply`, `@layer`, and `@theme`.
jasonsmithio pushed a commit to paddleboarddev/paddleboard that referenced this pull request May 31, 2026
Closes #44904

Adds the Tailwind CSS LSP as suggested here:
zed-industries/zed#39517 (comment).
This allows users to use the Tailwind CSS LSP for CSS files, to support
Tailwind specific rules.

Docs will be added in a separate PR after this is released

Release Notes:

- Add Tailwind CSS Mode support, for Tailwind specific CSS rules like
`@apply`, `@layer`, and `@theme`.
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Closes zed-industries#44904

Adds the Tailwind CSS LSP as suggested here:
zed-industries#39517 (comment).
This allows users to use the Tailwind CSS LSP for CSS files, to support
Tailwind specific rules.

Docs will be added in a separate PR after this is released

Release Notes:

- Add Tailwind CSS Mode support, for Tailwind specific CSS rules like
`@apply`, `@layer`, and `@theme`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

No open projects
Status: Community PRs

Development

Successfully merging this pull request may close these issues.

6 participants