Skip to content

Commit b3595f8

Browse files
committed
upgrade tailwind
1 parent ebe17dc commit b3595f8

File tree

6 files changed

+417
-533
lines changed

6 files changed

+417
-533
lines changed

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
"react-dom": "^19.1.0"
2525
},
2626
"devDependencies": {
27+
"@tailwindcss/postcss": "^4.1.5",
2728
"@testing-library/jest-dom": "^6.6.3",
2829
"@testing-library/react": "^16.3.0",
2930
"@types/react": "^19.1.3",
3031
"@types/react-dom": "^19.1.3",
3132
"@vitejs/plugin-react-swc": "^3.9.0",
32-
"autoprefixer": "^10.4.19",
3333
"eslint-plugin-react-hooks": "^5.2.0",
3434
"eslint-plugin-react-refresh": "^0.4.20",
3535
"jsdom": "^26.1.0",
3636
"postcss": "^8.4.39",
37-
"tailwindcss": "^3.4.4",
37+
"tailwindcss": "^4.1.5",
3838
"vite": "^6.3.5",
3939
"vitest": "^3.1.3"
4040
}

client/postcss.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
3+
'@tailwindcss/postcss': {},
54
},
65
};

client/src/components/ui.modal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,18 @@ export const Modal = ({
5252
return (
5353
<div
5454
className={classNames(
55-
'fixed inset-0 bg-black bg-opacity-70 flex justify-center items-center z-50',
56-
isOpen ? 'animate-fadeIn' : 'animate-fadeOut',
55+
'fixed inset-0 bg-black/70 flex justify-center items-center',
56+
isOpen ? 'animate-(--animate-fade-in)' : 'animate-(--animate-fade-out)',
5757
)}
5858
onClick={onClose}
5959
onAnimationEnd={handleAnimationEnd}
6060
>
6161
<div
6262
className={classNames(
63-
'rounded-lg p-6 m-4',
64-
isOpen ? 'animate-scaleIn' : 'animate-scaleOut',
63+
'relative rounded-lg p-6 m-4',
64+
isOpen
65+
? 'animate-(--animate-scale-in)'
66+
: 'animate-(--animate-scale-out)',
6567
className ?? '',
6668
)}
6769
onClick={(e) => e.stopPropagation()}

client/src/index.css

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,68 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
3+
@theme {
4+
--animate-fade-in: fadeIn 0.3s ease-out forwards;
5+
--animate-fade-out: fadeOut 0.3s ease-out forwards;
6+
--animate-scale-in: scaleIn 0.3s ease-out forwards;
7+
--animate-scale-out: scaleOut 0.3s ease-out forwards;
8+
9+
--font-sans: Ubuntu, sans-serif;
10+
11+
@keyframes fadeIn {
12+
0% {
13+
opacity: 0;
14+
}
15+
100% {
16+
opacity: 1;
17+
}
18+
}
19+
@keyframes fadeOut {
20+
0% {
21+
opacity: 1;
22+
}
23+
100% {
24+
opacity: 0;
25+
}
26+
}
27+
@keyframes scaleIn {
28+
0% {
29+
transform: scale(0.95);
30+
opacity: 0;
31+
}
32+
100% {
33+
transform: scale(1);
34+
opacity: 1;
35+
}
36+
}
37+
@keyframes scaleOut {
38+
0% {
39+
transform: scale(1);
40+
opacity: 1;
41+
}
42+
100% {
43+
transform: scale(0.95);
44+
opacity: 0;
45+
}
46+
}
47+
}
48+
49+
/*
50+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
51+
so we've added these compatibility styles to make sure everything still
52+
looks the same as it did with Tailwind CSS v3.
53+
54+
If we ever want to remove these styles, we need to add an explicit border
55+
color utility to any element that depends on these defaults.
56+
*/
57+
@layer base {
58+
*,
59+
::after,
60+
::before,
61+
::backdrop,
62+
::file-selector-button {
63+
border-color: var(--color-gray-200, currentcolor);
64+
}
65+
}
466

567
@layer base {
668
html {

client/tailwind.config.ts

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

0 commit comments

Comments
 (0)