-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly validate
theme(…)
function paths in v4 (#1074)
In v4 currently using the theme function in your CSS will show diagnostics about the theme config keys not existing regardless of the theme key. We've done two things here: - We compile a candidate with the theme function to see if the theme key exists. While this isn't an optimal solution it works without needing to introduce new APIs into v4 — also prevents us from having to expose the legacy resolved config anywhere in v4. - We look at all currently registered theme keys to offer suggestions in case you type a theme key incorrectly _as long as it's a CSS variable_. In v4 suggestions for legacy theme config values is not implemented. --------- Co-authored-by: Robin Malfait <[email protected]>
- Loading branch information
1 parent
8a39555
commit 5798007
Showing
8 changed files
with
343 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/app.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import 'tailwindcss'; | ||
|
||
@theme prefix(tw) { | ||
--color-potato: #907a70; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/tailwindcss-language-server/tests/fixtures/v4/with-prefix/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"tailwindcss": "^4.0.0-alpha.30" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.