Skip to content
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

feat(tailwind): support v4 #13049

Merged
merged 29 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5619b9d
feat: work on tailwind v4
florian-lefebvre Jan 23, 2025
375f7f9
feat: refactor
florian-lefebvre Jan 23, 2025
dc7e433
test
florian-lefebvre Jan 23, 2025
5c9f155
feat: write file
florian-lefebvre Jan 23, 2025
c78b6ef
feat: update fixture
florian-lefebvre Jan 23, 2025
6af5580
feat: create css file
florian-lefebvre Jan 23, 2025
bc11481
feat: astro add
florian-lefebvre Jan 23, 2025
83eea24
feat: example
florian-lefebvre Jan 23, 2025
8e774c9
feat: todos
florian-lefebvre Jan 23, 2025
c397877
Update .changeset/four-chairs-exercise.md
florian-lefebvre Jan 23, 2025
74f8d17
fix: typo
florian-lefebvre Jan 23, 2025
b56f2fb
fix: test
florian-lefebvre Jan 23, 2025
a2b75db
fix: test
florian-lefebvre Jan 23, 2025
8d14fee
fix: color
florian-lefebvre Jan 23, 2025
7ee87b9
Update .changeset/four-chairs-exercise.md
florian-lefebvre Jan 23, 2025
f2da6d8
fix: tests
florian-lefebvre Jan 23, 2025
bc0829b
Merge branch 'feat/tailwind-v4' of https://github.com/withastro/astro…
florian-lefebvre Jan 23, 2025
2b523d9
chore: changeset
florian-lefebvre Jan 23, 2025
1990a1d
Update curvy-penguins-act.md
florian-lefebvre Jan 24, 2025
773187e
Merge branch 'main' into feat/tailwind-v4
florian-lefebvre Jan 27, 2025
9de3c4f
Discard changes to packages/integrations/tailwind/base.css
florian-lefebvre Jan 27, 2025
93b81be
Discard changes to packages/integrations/tailwind/package.json
florian-lefebvre Jan 27, 2025
c0a90e1
Discard changes to packages/integrations/tailwind/src/index.ts
florian-lefebvre Jan 27, 2025
45e920d
Discard changes to packages/integrations/tailwind/test/basic.test.js
florian-lefebvre Jan 27, 2025
5e18866
Discard changes to packages/integrations/tailwind/test/fixtures/basic…
florian-lefebvre Jan 27, 2025
97a220a
Discard changes to packages/integrations/tailwind/test/fixtures/basic…
florian-lefebvre Jan 27, 2025
079cb5a
feat: update changeset
florian-lefebvre Jan 27, 2025
09f0542
chore: deps
florian-lefebvre Jan 27, 2025
f620e48
Update .changeset/curvy-penguins-act.md
florian-lefebvre Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: tests
florian-lefebvre committed Jan 23, 2025
commit f2da6d86a1364da785a1af5c129bc3a150cb205b
11 changes: 4 additions & 7 deletions packages/astro/test/fixtures/astro-scripts/astro.config.mjs
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()]
}
});
3 changes: 2 additions & 1 deletion packages/astro/test/fixtures/astro-scripts/package.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"astro": "workspace:*",
"@astrojs/tailwind": "workspace:*"
"@tailwindcss/vite": "^4.0.0",
"tailwindcss": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import './styles/global.css';
---

<html lang="en">
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
import NoHoistClassic from '../components/NoHoistClassic.astro';
---

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
import NoHoistModule from '../components/NoHoistModule.astro';
---

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
import Widget from '../components/Widget.astro';
import Widget2 from '../components/Widget2.astro';
---
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
const components = await Astro.glob('/src/components/Glob/*');
const MyComponent = components[0].default;
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
import '../styles/global.css';
---

<html>
<head>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
import Inline from '../components/Inline.astro';
---

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
import '../styles/global.css';
---

<html>
<head>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'tailwindcss';

This file was deleted.

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()],
}
});
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"astro": "workspace:*",
"@astrojs/tailwind": "workspace:*"
"@tailwindcss/vite": "^4.0.0",
"tailwindcss": "^4.0.0"
}
}
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'tailwindcss';

This file was deleted.

2 changes: 1 addition & 1 deletion packages/astro/test/middleware.test.js
Original file line number Diff line number Diff line change
@@ -373,6 +373,6 @@ describe('Middleware with tailwind', () => {
const bundledCSS = (await fixture.readFile(bundledCSSHREF.replace(/^\/?/, '/')))
.replace(/\s/g, '')
.replace('/n', '');
assert.equal(bundledCSS.includes('--tw-content'), true);
assert.equal(bundledCSS.includes('--tw'), true);
});
});
18 changes: 12 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.