Skip to content

Commit c64673e

Browse files
committed
refactor: Upgrade to Tailwind CSS v4, adopting new CSS-based configuration and @tailwindcss/vite integration.
1 parent 5b0d823 commit c64673e

File tree

5 files changed

+44
-70
lines changed

5 files changed

+44
-70
lines changed

astro.config.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "astro/config";
22
import react from "@astrojs/react";
3-
import tailwind from "@astrojs/tailwind";
3+
import tailwindcss from "@tailwindcss/vite";
44
import sitemap from "@astrojs/sitemap";
55

66
export default defineConfig({
@@ -14,7 +14,6 @@ export default defineConfig({
1414
},
1515
output: "static",
1616
integrations: [
17-
tailwind(),
1817
react(),
1918
sitemap({
2019
i18n: {
@@ -29,19 +28,20 @@ export default defineConfig({
2928
// AQUI ESTÁ LA MAGIA: Nivel raíz de Astro
3029
server: {
3130
host: true,
32-
allowedHosts: true
31+
allowedHosts: true,
3332
},
3433
preview: {
3534
host: true,
36-
allowedHosts: true
35+
allowedHosts: true,
3736
},
3837
// Lo dejamos en Vite también como doble seguro
3938
vite: {
39+
plugins: [tailwindcss()],
4040
preview: {
41-
allowedHosts: true
41+
allowedHosts: true,
4242
},
4343
server: {
44-
allowedHosts: true
45-
}
46-
}
44+
allowedHosts: true,
45+
},
46+
},
4747
});

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
"react-dom": "^19.2.3"
3030
},
3131
"devDependencies": {
32-
"@astrojs/tailwind": "^6.0.2",
33-
"@tailwindcss/forms": "^0.5.11",
34-
"@tailwindcss/typography": "^0.5.19",
35-
"autoprefixer": "^10.4.23",
36-
"postcss": "^8.5.6",
32+
"@tailwindcss/vite": "^4.2.1",
3733
"tailwindcss": "^4.2.1"
3834
},
3935
"pnpm": {

postcss.config.cjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/styles/tailwind.css

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
2+
3+
@theme {
4+
--color-primary: #ff6f61;
5+
--color-secondary: #6b5b95;
6+
--color-darkbg: #1a1a1a;
7+
--color-lightbg: #f4f4f4;
8+
9+
--shadow-xl-dark:
10+
0 20px 25px -5px rgba(255, 255, 255, 0.1),
11+
0 8px 10px -6px rgba(255, 255, 255, 0.1);
12+
13+
--animate-fade-in: fadeIn 0.5s ease-in-out;
14+
--animate-slide-up: slideUp 0.5s ease-in-out;
15+
}
16+
17+
@keyframes fadeIn {
18+
0% {
19+
opacity: 0;
20+
}
21+
100% {
22+
opacity: 1;
23+
}
24+
}
25+
26+
@keyframes slideUp {
27+
0% {
28+
transform: translateY(20px);
29+
opacity: 0;
30+
}
31+
100% {
32+
transform: translateY(0);
33+
opacity: 1;
34+
}
35+
}

tailwind.config.cjs

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)