feat: add Tailwind CSS LSP

This commit is contained in:
Oliver Ladner 2025-04-04 11:36:20 +02:00
commit 60a8a057a5
2 changed files with 35 additions and 0 deletions

34
lsp/tailwind.lua Normal file
View file

@ -0,0 +1,34 @@
---@type vim.lsp.Config
return {
cmd = { "tailwindcss-language-server", "--stdio" },
root_markers = { "tailwind.config.js" },
filetypes = { "javascript", "htmldjango", "css" },
settings = {
tailwindCSS = {
validate = true,
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidScreen = "error",
invalidVariant = "error",
invalidConfigPath = "error",
invalidTailwindDirective = "error",
recommendedVariantOrder = "warning",
},
classAttributes = {
"class",
"className",
"class:list",
"classList",
"ngClass",
},
includeLanguages = {
eelixir = "html-eex",
eruby = "erb",
templ = "html",
htmlangular = "html",
htmldjango = "html",
},
},
},
}

View file

@ -6,6 +6,7 @@ vim.lsp.enable({
"yaml",
"ansible",
"marksman",
"tailwind",
})
-- Set highlight on search