You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify how the configFile option works with v4 (#1167)
This updates the readme to detail how the
`tailwindCSS.experimental.configFile` option is meant to be used with
v4.
This PR *also* does two additional things:
- Makes sure this works even with the bundled / fallback version of v4
- Adds tests verifying this behavior
---------
Co-authored-by: Jonathan Reinink <[email protected]>
Copy file name to clipboardExpand all lines: packages/vscode-tailwindcss/CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
- Support style-rule like completions inside `@variant` ([#1165](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1165))
12
12
- Make sure `@slot` isn't considered an unknown at-rule ([#1165](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1165))
13
13
- Fix equivalent calculation when using prefixes in v4 ([#1166](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1166))
14
+
- Fix use of `tailwindCSS.experimental.configFile` option when using the bundled version of v4 ([#1167](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1167))
Copy file name to clipboardExpand all lines: packages/vscode-tailwindcss/README.md
+31-3
Original file line number
Diff line number
Diff line change
@@ -164,15 +164,43 @@ Enable the Node.js inspector agent for the language server and listen on the spe
164
164
165
165
**Default: `null`**
166
166
167
-
By default the extension will automatically use the first `tailwind.config.{js,cjs,mjs,ts,cts,mts}` file that it can find to provide Tailwind CSS IntelliSense. Use this setting to manually specify the config file(s) yourself instead.
167
+
This setting allows you to manually specify the CSS entrypoints (for v4 projects) or the Tailwind configuration file (for v3 projects). By default, the extension attempts to detect your project setup automatically:
168
168
169
-
If your project contains a single Tailwind config file you can specify a string value:
169
+
-**For Tailwind CSS v4**: The extension scans your project for CSS files and determines the "root" CSS file.
170
+
-**For Tailwind CSS v3 (and earlier)**: The extension automatically uses the first `tailwind.config.{js,cjs,mjs,ts,cts,mts}` file it finds.
171
+
172
+
If IntelliSense is unable to detect your project, you can use this setting to define your config files manually.
173
+
174
+
#### Tailwind CSS v4.x (CSS entrypoints)
175
+
176
+
For v4 projects, specify the CSS file(s) that serve as your Tailwind entrypoints.
177
+
178
+
If your project contains a single CSS entrypoint, set this option to a string:
For projects with multiple CSS entrypoints, use an object where each key is a file path and each value is a glob pattern (or array of patterns) representing the files it applies to:
185
+
186
+
```json
187
+
"tailwindCSS.experimental.configFile": {
188
+
"packages/a/src/app.css": "packages/a/src/**",
189
+
"packages/b/src/app.css": "packages/b/src/**"
190
+
}
191
+
```
192
+
193
+
#### Tailwind CSS v3.x and earlier (config files)
194
+
195
+
For v3 projects and below, specify the Tailwind configuration file(s) instead.
196
+
197
+
If your project contains a single Tailwind config, set this option to a string:
For projects with multiple config files use an object where each key is a config file path and each value is a glob pattern (or array of glob patterns) representing the set of files that the config file applies to:
203
+
For projects with multiple config files, use an object where each key is a config file path and each value is a glob pattern (or array of patterns) representing the files it applies to:
0 commit comments