Tailwind CSS IntelliSense and Twin #227
Replies: 13 comments 15 replies
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
Is there anyway to show an error in vscode linter, as it already shows in the console and in the browser, when a wrong class is added to twin? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been hidden.
This comment has been hidden.
-
How about WebStorm? |
Beta Was this translation helpful? Give feedback.
-
@ben-rogerson @lightyen is there any way for the It only seems to autocomplete classes when I manually import the macro. Also for some reason, the classes don't have a green color when using |
Beta Was this translation helpful? Give feedback.
-
@ben-rogerson awesome, it works great! |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
About the feature " How should it be configured to get a hint in |
Beta Was this translation helpful? Give feedback.
-
Is it possible to have it in webstorm ?? 👍 |
Beta Was this translation helpful? Give feedback.
-
For Neovim support, I translated the recommended config to Lua for use with lspconfig: require('lspconfig').tailwindcss.setup {
settings = {
scss = { validate = false },
editor = {
quickSuggestions = { strings = true },
autoClosingQuotes = 'always',
},
tailwindCSS = {
experimental = {
classRegex = {
'tw`([^`]*)', -- tw`...`
'tw="([^"]*)', -- <div tw="..." />
'tw={"([^"}]*)', -- <div tw={"..."} />
'tw\\.\\w+`([^`]*)', -- tw.xxx`...`
'tw\\(.*?\\)`([^`]*)', -- tw(Component)`...`
},
},
includeLanguages = {
typescript = 'javascript',
typescriptreact = 'javascript',
},
},
},
} |
Beta Was this translation helpful? Give feedback.
-
When using this with groups, IntelliSense gives a wrong warning: |
Beta Was this translation helpful? Give feedback.
-
Good news, Brad has just pushed a new release that includes an experimental custom regex feature.
Installation
Install the extension in VSCode:
From your command palette select: "Preferences: Open Settings (JSON)" and add this to your settings:
Note: If you use single quotes in your project then replace them in the regex sets above.
In order for the extension to activate you must have tailwindcss installed and a Tailwind config file named
tailwind.config.js
ortailwind.js
in your workspace.You'll also need to install PostCSS in your project:
You'll then see class auto-completions from your merged tailwind.config
Beta Was this translation helpful? Give feedback.
All reactions