-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(tailwind): support v4 #13049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(tailwind): support v4 #13049
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5619b9d
feat: work on tailwind v4
florian-lefebvre 375f7f9
feat: refactor
florian-lefebvre dc7e433
test
florian-lefebvre 5c9f155
feat: write file
florian-lefebvre c78b6ef
feat: update fixture
florian-lefebvre 6af5580
feat: create css file
florian-lefebvre bc11481
feat: astro add
florian-lefebvre 83eea24
feat: example
florian-lefebvre 8e774c9
feat: todos
florian-lefebvre c397877
Update .changeset/four-chairs-exercise.md
florian-lefebvre 74f8d17
fix: typo
florian-lefebvre b56f2fb
fix: test
florian-lefebvre a2b75db
fix: test
florian-lefebvre 8d14fee
fix: color
florian-lefebvre 7ee87b9
Update .changeset/four-chairs-exercise.md
florian-lefebvre f2da6d8
fix: tests
florian-lefebvre bc0829b
Merge branch 'feat/tailwind-v4' of https://github.com/withastro/astro…
florian-lefebvre 2b523d9
chore: changeset
florian-lefebvre 1990a1d
Update curvy-penguins-act.md
florian-lefebvre 773187e
Merge branch 'main' into feat/tailwind-v4
florian-lefebvre 9de3c4f
Discard changes to packages/integrations/tailwind/base.css
florian-lefebvre 93b81be
Discard changes to packages/integrations/tailwind/package.json
florian-lefebvre c0a90e1
Discard changes to packages/integrations/tailwind/src/index.ts
florian-lefebvre 45e920d
Discard changes to packages/integrations/tailwind/test/basic.test.js
florian-lefebvre 5e18866
Discard changes to packages/integrations/tailwind/test/fixtures/basic…
florian-lefebvre 97a220a
Discard changes to packages/integrations/tailwind/test/fixtures/basic…
florian-lefebvre 079cb5a
feat: update changeset
florian-lefebvre 09f0542
chore: deps
florian-lefebvre f620e48
Update .changeset/curvy-penguins-act.md
florian-lefebvre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,11 @@ | ||
--- | ||
'@astrojs/tailwind': major | ||
--- | ||
|
||
Drops support for Astro <= 5.0 and Tailwind <= 4.0 | ||
|
||
Tailwind CSS now offers a Vite plugin which is the preferred way to use Tailwind 4 in Astro. This Astro integration is now provided only as a convenience for existing projects if you're unable to upgrade to the Vite plugin at this time. You may continue to use this integration until it is removed. | ||
|
||
However, we recommend that you uninstall this integration as soon as you are able. The `astro add tailwind` command will now set up the Vite plugin for you and will no longer install this integration. Or, you can follow the [Tailwind documentation for manual installation](https://tailwindcss.com/docs/installation/framework-guides/astro). | ||
|
||
Note the `nesting` option is removed as it's supported out of the box. | ||
This file contains hidden or 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 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Updates `astro add tailwind` to add the `@tailwindcss/vite` plugin instead of the `@astrojs/tailwind` integration |
This file contains hidden or 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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// @ts-check | ||
import { defineConfig } from 'astro/config'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import tailwindcss from '@tailwindcss/vite'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [tailwind()], | ||
vite: { | ||
plugins: [tailwindcss()] | ||
} | ||
}); |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import '../styles/global.css'; | ||
const { content } = Astro.props; | ||
--- | ||
|
||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import '../styles/global.css'; | ||
// Component Imports | ||
import Button from '../components/Button.astro'; | ||
|
||
|
This file contains hidden or 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 @@ | ||
@import "tailwindcss"; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
packages/astro/e2e/fixtures/tailwindcss/src/styles/global.css
This file contains hidden or 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,7 @@ | ||
@import 'tailwindcss'; | ||
|
||
@theme { | ||
--color-dawn: #f3e9fa; | ||
--color-dusk: #514375; | ||
--color-midnight: #31274a; | ||
} |
14 changes: 0 additions & 14 deletions
14
packages/astro/e2e/fixtures/tailwindcss/tailwind.config.js
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
11 changes: 4 additions & 7 deletions
11
packages/astro/test/fixtures/astro-scripts/astro.config.mjs
This file contains hidden or 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import { defineConfig } from 'astro/config'; | ||
import tailwindcss from '@tailwindcss/vite'; | ||
|
||
export default defineConfig({ | ||
integrations: [ | ||
tailwind({ | ||
configFile: fileURLToPath(new URL('./tailwind.config.cjs', import.meta.url)), | ||
}), | ||
], | ||
vite: { | ||
plugins: [tailwindcss()] | ||
} | ||
}); |
This file contains hidden or 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
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/external-page.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import './styles/global.css'; | ||
--- | ||
|
||
<html lang="en"> | ||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/pages/external-no-hoist-classic.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import '../styles/global.css'; | ||
import NoHoistClassic from '../components/NoHoistClassic.astro'; | ||
--- | ||
|
||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/pages/external-no-hoist.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import '../styles/global.css'; | ||
import NoHoistModule from '../components/NoHoistModule.astro'; | ||
--- | ||
|
||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/pages/external.astro
This file contains hidden or 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
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/pages/glob.astro
This file contains hidden or 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
3 changes: 3 additions & 0 deletions
3
packages/astro/test/fixtures/astro-scripts/src/pages/inline-in-page.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
import '../styles/global.css'; | ||
--- | ||
|
||
<html> | ||
<head> | ||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/pages/inline.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
import '../styles/global.css'; | ||
import Inline from '../components/Inline.astro'; | ||
--- | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
packages/astro/test/fixtures/astro-scripts/src/pages/with-styles.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
import '../styles/global.css'; | ||
--- | ||
|
||
<html> | ||
<head> | ||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/astro-scripts/src/styles/global.css
This file contains hidden or 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 @@ | ||
@import 'tailwindcss'; |
8 changes: 0 additions & 8 deletions
8
packages/astro/test/fixtures/astro-scripts/tailwind.config.cjs
This file was deleted.
Oops, something went wrong.
11 changes: 4 additions & 7 deletions
11
packages/astro/test/fixtures/middleware-tailwind/astro.config.mjs
This file contains hidden or 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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import { defineConfig } from 'astro/config'; | ||
import tailwindcss from "@tailwindcss/vite" | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [ | ||
tailwind({ | ||
configFile: fileURLToPath(new URL('./tailwind.config.cjs', import.meta.url)), | ||
}), | ||
], | ||
vite: { | ||
plugins: [tailwindcss()], | ||
} | ||
}); |
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
packages/astro/test/fixtures/middleware-tailwind/src/pages/index.astro
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
import '../styles/global.css'; | ||
--- | ||
|
||
<h1 class="text-blue-500 text-2xl font-bold">Hello world</h1> | ||
|
||
<style> | ||
|
1 change: 1 addition & 0 deletions
1
packages/astro/test/fixtures/middleware-tailwind/src/styles/global.css
This file contains hidden or 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 @@ | ||
@import 'tailwindcss'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.