Skip to content

Commit 3db16ce

Browse files
authored
fix(tailwindcss): use ".git" root marker fallback for tailwind v4 #3980
Since tailwind v4 it is not required to have a tailwind.config.* in the project 1. The current configuration is preventing the LSP to attach to the configured file types in cases when no tailwind.config.* or none of the other markers (package.json etc.) is present. This commit fixes this limitation by providing .git as a fallback and by documenting this limitation.
1 parent 177be29 commit 3db16ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lsp/tailwindcss.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ return {
123123
'theme/static_src/tailwind.config.mjs',
124124
'theme/static_src/tailwind.config.ts',
125125
'theme/static_src/postcss.config.js',
126+
-- Fallback for tailwind v4, where tailwind.config.* is not required anymore
127+
'.git',
126128
}
127129
local fname = vim.api.nvim_buf_get_name(bufnr)
128130
root_files = util.insert_package_json(root_files, 'tailwindcss', fname)

0 commit comments

Comments
 (0)