Skip to content

Commit

Permalink
feat: example
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre committed Jan 23, 2025
1 parent bc11481 commit 83eea24
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-chairs-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

aaa
6 changes: 4 additions & 2 deletions examples/with-tailwindcss/astro.config.mjs
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()]
}
});
6 changes: 2 additions & 4 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
},
"dependencies": {
"@astrojs/mdx": "^4.0.7",
"@astrojs/tailwind": "^5.1.5",
"@tailwindcss/vite": "^4.0.0",
"@types/canvas-confetti": "^1.9.0",
"astro": "^5.1.8",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17"
"tailwindcss": "^4.0.0"
}
}
1 change: 1 addition & 0 deletions examples/with-tailwindcss/src/layouts/main.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/global.css';
const { content } = Astro.props;
---

Expand Down
1 change: 1 addition & 0 deletions examples/with-tailwindcss/src/pages/index.astro
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';
Expand Down
1 change: 1 addition & 0 deletions examples/with-tailwindcss/src/styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "tailwindcss";
7 changes: 0 additions & 7 deletions examples/with-tailwindcss/tailwind.config.cjs

This file was deleted.

5 changes: 4 additions & 1 deletion packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,10 @@ async function validateIntegrations(integrations: string[]): Promise<Integration
}

if (integration === 'tailwind') {
dependencies.push(['@tailwindcss/vite', '^4.0.0']);
dependencies = [
['@tailwindcss/vite', '^4.0.0'],
['tailwindcss', '^4.0.0'],
];
}

return { id: integration, packageName, dependencies, type: integrationType };
Expand Down
16 changes: 5 additions & 11 deletions pnpm-lock.yaml

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

0 comments on commit 83eea24

Please sign in to comment.