-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hoist
@import
nodes to the top in the project locator
This ensures project initialization can proceed far enough that Tailwind CSS itself should attempt to initalize. It also means we can reliably detect this case and show an error in the console.
- Loading branch information
1 parent
009c0c5
commit 85b1042
Showing
8 changed files
with
90 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
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
5 changes: 5 additions & 0 deletions
5
packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/a.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 @@ | ||
@layer base { | ||
:root { | ||
font-family: sans-serif; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/b.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 @@ | ||
@layer base { | ||
:root { | ||
--foo: red; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/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/invalid-import-order/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-beta.6" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/tailwindcss-language-server/tests/fixtures/v4/invalid-import-order/tailwind.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,14 @@ | ||
@import 'tailwindcss'; | ||
|
||
/* | ||
* This is invalid in this position because some `@import`s are not at the top of the file. | ||
* We don't want project discovery to fail so we hoist them up and then warn in the console. | ||
*/ | ||
@variant dark (&:where(.dark, .dark *)); | ||
|
||
@import './a.css'; | ||
@import './b.css'; | ||
|
||
@theme { | ||
--color-primary: #c0ffee; | ||
} |