{"id":13804967,"url":"https://github.com/merrickluo/lsp-tailwindcss","last_synced_at":"2026-01-28T16:02:21.610Z","repository":{"id":39153351,"uuid":"273465856","full_name":"merrickluo/lsp-tailwindcss","owner":"merrickluo","description":"the lsp-mode client for tailwindcss","archived":false,"fork":false,"pushed_at":"2025-10-05T14:22:54.000Z","size":302,"stargazers_count":213,"open_issues_count":7,"forks_count":26,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-05T15:22:06.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/merrickluo.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-19T10:23:35.000Z","updated_at":"2025-10-05T14:22:59.000Z","dependencies_parsed_at":"2024-11-18T21:39:36.544Z","dependency_job_id":"cac3558a-0bac-4e6c-bfed-832de32f5377","html_url":"https://github.com/merrickluo/lsp-tailwindcss","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/merrickluo/lsp-tailwindcss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merrickluo%2Flsp-tailwindcss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merrickluo%2Flsp-tailwindcss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merrickluo%2Flsp-tailwindcss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merrickluo%2Flsp-tailwindcss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/merrickluo","download_url":"https://codeload.github.com/merrickluo/lsp-tailwindcss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merrickluo%2Flsp-tailwindcss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:00:55.747Z","updated_at":"2026-01-28T16:02:21.603Z","avatar_url":"https://github.com/merrickluo.png","language":"Emacs Lisp","funding_links":[],"categories":["IDE extensions"],"sub_categories":[],"readme":"[[https://melpa.org/#/lsp-tailwindcss][file:https://melpa.org/packages/lsp-tailwindcss-badge.svg]]\n\n* lsp-tailwindcss\n\nThe [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]] client for tailwindcss, using language server from [[https://github.com/tailwindlabs/tailwindcss-intellisense][official vscode plugin]].\n\n[[file:images/autocomplete.png]]\n\n* Installation\n** Doom Emacs\nin ~packages.el~\n#+begin_src emacs-lisp\n(package! lsp-tailwindcss :recipe (:host github :repo \"merrickluo/lsp-tailwindcss\"))\n#+end_src\n\nin ~config.el~\n#+begin_src emacs-lisp\n(use-package! lsp-tailwindcss :after lsp-mode)\n#+end_src\n\n** straight.el\n#+begin_src emacs-lisp\n(straight-use-package\n '(lsp-tailwindcss :type git :host github :repo \"merrickluo/lsp-tailwindcss\"))\n#+end_src\n\n** Language Server\n*** Installation\n+ =M-x lsp-install-server=, then select =tailwindcss=.\n\n*** Update\n+ =C-u M-x lsp-install-server=, then select =tailwindcss=.\n\n* Changelog\n** 0.3\n*** breaking changes\n+ back to use the vscode extension asset for language server installation, since the npm package don't get updates.\n\n*** minor changes\n+ more language server settings mapped to custom variables.\n+ add new configuration =lsp-tailwindcss-skip-config-check= to skip the config file check, since it's hard to keep it the same with the language server.\n\n** 0.2\n*** breaking changes\n+ now uses [[https://www.npmjs.com/package/@tailwindcss/language-server][tailwindcss language server]] instead of manually download the vscode extension file.\n\n*** major changes\n+ added =lsp-tailwindcss-major-modes=, see details in #Customization section.\n+ allow global and workspace configuration for tailwindcss-language-server.\n+ make variables =lsp-tailwindcss-server-dir=, =lsp-tailwindcss-server-file=, =lsp-tailwindcss-auto-install-server=, =lsp-tailwindcss-server-version= obsolete.\n\n* Customization\n** lsp-tailwindcss\n*** =lsp-tailwindcss-add-on-mode=\nSpecify that if lsp-tailwindcss runs in add-on mode, see [[https://emacs-lsp.github.io/lsp-mode/page/faq/][in lsp-mode's documentation.]] This must be set before the package loads (use the init block in use-package instead of config block).\n#+begin_src emacs-lisp\n(use-package lsp-tailwindcss\n  :after lsp-mode\n  :init\n  (setq lsp-tailwindcss-add-on-mode t))\n#+end_src\n\ndefault: =nil=.\n\n*** =lsp-tailwindcss-major-modes= (since 0.2)\nSpecify lsp-tailwindcss should only starts when major-mode in the list or derived from them.\ndefault: =rjsx-mode web-mode html-mode css-mode typescript-mode typescript-tsx-mode=.\n\n** tailwindcss-language-server\nAll settings described in [[https://github.com/tailwindlabs/tailwindcss-intellisense#extension-settings][tailwindcss-intellisense]] except:\n+ =tailwindCSS.includeLanguages=\n  The activation of the language server is controlled by =lsp-tailwindcss--activate-p=, so this is not needed.\n\n+ =tailwindCSS.colorDecorators=\n  Emacs does not support color decorators.\n\nDefault value follows the default value in the documentation.\n\n*** Global Configuration\nCustom variable naming convention:\n=tailwindCSS.emmetCompletions= =\u003e =lsp-tailwindcss-emmet-completions=.\n\n** Rustywind (class sorter)\nThere are two functions integrate the [[https://github.com/avencera/rustywind][rustywind]] class sorter, =lsp-tailwindcss-rustywind= and =lsp-tailwindcss-rustywind-before-save=.\n\nAfter install rustywind =npm i -g rustywind=, run =lsp-tailwindcss-rustywind= manually or add it to before-save-hook to use it.\n\n#+begin_src emacs-lisp\n(add-hook 'before-save-hook 'lsp-tailwindcss-rustywind-before-save)\n#+end_src\n\n* Troubleshooting\n1. make sure the language server is installed, see [[#language-server][Install language server]].\n2. run =M-x lsp-describe-sessions= to see if the =tailwindcss= language server is running.\n3. run =M-x lsp-workspace-show-log= to see if there are any errors reported by language server.\n\n* Q\u0026A\n** Unable to calculate the languageId for buffer ...\nIf you want to use lsp-tailwindcss in some other file types, like =erb=, you might see this error report from =lsp-mode=, the solution is configure the language id for it.\n\n#+begin_src emacs-lisp\n(add-to-list 'lsp-language-id-configuration '(\".*\\\\.erb$\" . \"html\"))\n#+end_src\n\nThis is a requirement for lsp-mode, not just for =lsp-tailwindcss=, see https://github.com/emacs-lsp/lsp-mode/blob/563233fe72de6f32ffc6a1b3db0ec7f49c12cb50/lsp-mode.el#L694 .\n\n** How to set up [[https://github.com/ben-rogerson/twin.macro][twin.macro]]?\n\ntwin.macro can be integrated using =lsp-tailwindcss-experimental-class-regex= variable (which is alias to =tailwindCSS.experimental.classRegex= . see the reference to [[https://github.com/ben-rogerson/twin.macro/discussions/227][discussion]])\n\n#+begin_src emacs-lisp\n(use-package! lsp-tailwindcss\n  :after lsp-mode\n  :init\n  (setq! lsp-tailwindcss-experimental-class-regex [\"tw([^]*)\" \"tw=\\\"([^\\\"]*)\" \"tw={\\\"([^\\\"}]*)\" \"tw\\\\.\\\\w+([^]*)\" \"tw\\\\(.*?\\\\)([^]*)\"]))\n#+end_src\n\n\nTake a note that it can lead to [[https://emacs-lsp.github.io/lsp-mode/page/faq/#i-have-multiple-language-servers-registered-for-language-foo-which-one-will-be-used-when-opening-a-project][the conflict of lsp-servers priorities]] (i.e. some of the servers will not start). To fix this you need to use =lsp-tailwindcss-add-on-mode= too.\n\nSet up with add-on mode:\n#+begin_src emacs-lisp\n(use-package! lsp-tailwindcss\n  :after lsp-mode\n  :init\n  (setq! lsp-tailwindcss-experimental-class-regex [\"tw`([^`]*)\" \"tw=\\\"([^\\\"]*)\" \"tw={\\\"([^\\\"}]*)\" \"tw\\\\.\\\\w+`([^`]*)\" \"tw\\\\(.*?\\\\)`([^`]*)\"]) (setq! lsp-tailwindcss-add-on-mode t))\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerrickluo%2Flsp-tailwindcss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmerrickluo%2Flsp-tailwindcss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerrickluo%2Flsp-tailwindcss/lists"}