languages: Add Tailwind CSS support for TypeScript (#38254)

Closes #37028

I noticed many projects use Tailwind in plain TypeScript (.ts) files, so
it makes sense to support them out of the box, alongside .js and .tsx
files we already handle. For example, see
[supabase](https://github.com/supabase/supabase/blob/master/packages/ui/src/lib/theme/defaultTheme.ts).

Note: You’ll still need to add `"classFunctions": ["cva", "cx"],`
manually for Tailwind completions to work in `cva` type methods. This is
because you don’t want completions on every string, only in specific
methods or regex matches. This is documented.

Release Notes:

- Added out-of-the-box support for Tailwind completions in `.ts` files.
This commit is contained in:
Smit Barmase
2025-09-16 20:06:14 +05:30
committed by GitHub
parent af3bc45a26
commit a01a2ed0e0
4 changed files with 7 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@ To configure the Tailwind CSS language server, refer [to the extension settings]
"lsp": {
"tailwindcss-language-server": {
"settings": {
"classFunctions": ["cva", "cx"],
"experimental": {
"classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"],
},