Skip to content

Commit 98a02eb

Browse files
thecrypticacejunepilreinink
authored
Update project readme (#1364)
Closes #1321 Closes #1228 --------- Co-authored-by: Junepil Lee <hanu9257@gmail.com> Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
1 parent d39f17e commit 98a02eb

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

packages/vscode-tailwindcss/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Tailwind CSS IntelliSense enhances the Tailwind development experience by provid
66

77
**[Install via the Visual Studio Code Marketplace →](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)**
88

9-
In order for the extension to activate you must have [`tailwindcss` installed](https://tailwindcss.com/docs/installation) and a [Tailwind config file](https://tailwindcss.com/docs/installation#create-your-configuration-file) named `tailwind.config.{js,cjs,mjs,ts,cts,mts}` in your workspace.
9+
In order for the extension to activate you must have [`tailwindcss` installed](https://tailwindcss.com/docs/installation) and one of these:
10+
11+
- For v4 and later, a `.css` file that imports a Tailwind CSS stylesheet (e.g. `@import "tailwindcss"`)
12+
- For v3 and earlier, a [Tailwind CSS config file](https://v3.tailwindcss.com/docs/configuration#creating-your-configuration-file) named `tailwind.config.{js,cjs,mjs,ts,cts,mts}` in your workspace.
13+
- For v3 and earlier, a stylesheet that points to a config file via `@config`
1014

1115
## Features
1216

@@ -94,11 +98,13 @@ The HTML attributes for which to provide class completions, hover previews, lint
9498

9599
Functions in which to provide completions, hover previews, linting etc. Currently, this works for both function calls and tagged template literals in JavaScript / TypeScript.
96100

101+
Each entry is treated as regex pattern that matches on a function name. You *cannot* match on content before or after the function name — matches are limited to function names only.
102+
97103
Example:
98104

99105
```json
100106
{
101-
"tailwindCSS.classFunctions": ["tw", "clsx"]
107+
"tailwindCSS.classFunctions": ["tw", "clsx", "tw\\.[a-z-]+"]
102108
}
103109
```
104110

@@ -108,6 +114,7 @@ let classes2 = clsx([
108114
"flex bg-red-500",
109115
{ "text-red-500": true }
110116
])
117+
let element = tw.div`flex bg-red-500`
111118
```
112119

113120
### `tailwindCSS.colorDecorators`
@@ -237,7 +244,10 @@ For projects with multiple config files, use an object where each key is a confi
237244

238245
If you’re having issues getting the IntelliSense features to activate, there are a few things you can check:
239246

240-
- Ensure that you have a Tailwind config file in your workspace and that this is named `tailwind.config.{js,cjs,mjs,ts,cts,mts}`. Check out the Tailwind documentation for details on [creating a config file](https://tailwindcss.com/docs/configuration#creating-your-configuration-file).
241-
- Ensure that the `tailwindcss` module is installed in your workspace, via `npm`, `yarn`, or `pnpm`.
242-
- Make sure your VS Code settings aren’t causing your Tailwind config file to be hidden/ignored, for example via the `files.exclude` or `files.watcherExclude` settings.
247+
- You must have `tailwindcss` installed in your workspace via `npm`, `pnpm`, or `yarn`. The extension will then attempt to detect your Tailwind CSS configuration, which can be located in one of the following:
248+
- For Tailwind CSS **v4** projects, configuration defined directly within your main CSS file using directives like `@import "tailwindcss";` and `@theme { ... }`. Preprocessor files like Less, Sass, or Stylus are not supported. A `.css` file is **required** for IntelliSense to function.
249+
- For Tailwind CSS **v3 and earlier**, a Tailwind CSS config file in your workspace whose name matches (`tailwind.config.{js,cjs,mjs,ts,cts,mts}`), or a stylesheet that points to a config file via `@config`.
250+
251+
- Make sure your VS Code settings aren’t causing your stylesheet or your Tailwind CSS config file to be hidden/ignored, for example via the `files.exclude`, `files.watcherExclude`, or `tailwindCSS.files.exclude` settings.
243252
- Take a look at the language server output by running the `Tailwind CSS: Show Output` command from the command palette. This may show errors that are preventing the extension from activating.
253+
- For projects with multiple installations of Tailwind CSS, multiple config files, or several stylesheets with `@import "tailwindcss"` we recommend using the `tailwindCSS.experimental.configFile` setting to explicitly state your stylesheet or config paths.

0 commit comments

Comments
 (0)