Skip to content

Commit 206e03a

Browse files
Upgrade Tailwind CSS to v4 and migrate config, add @tailwindcss/vite plugin
1 parent 36eb0e7 commit 206e03a

21 files changed

Lines changed: 12856 additions & 121 deletions

bun.lockb

18.6 KB
Binary file not shown.

package-lock.json

Lines changed: 12726 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
"@graphql-codegen/client-preset": "^4.5.1",
5252
"@graphql-codegen/typescript-operations": "^4.3.1",
5353
"@graphql-codegen/typescript-react-apollo": "^4.3.3",
54+
"@tailwindcss/postcss": "^4.1.18",
55+
"@tailwindcss/vite": "^4.1.18",
5456
"@testing-library/jest-dom": "^6.6.3",
5557
"@testing-library/react": "^16.1.0",
5658
"@testing-library/user-event": "^14.5.2",
@@ -67,7 +69,6 @@
6769
"@vitejs/plugin-react-swc": "^3.7.2",
6870
"@vitest/coverage-v8": "^2.1.8",
6971
"@vitest/ui": "^2.1.8",
70-
"autoprefixer": "^10.4.20",
7172
"eslint": "^9.17.0",
7273
"eslint-config-prettier": "^9.1.0",
7374
"eslint-plugin-import": "^2.31.0",
@@ -78,8 +79,8 @@
7879
"msw": "^2.7.0",
7980
"postcss": "^8.4.49",
8081
"prettier": "^3.4.2",
81-
"prettier-plugin-tailwindcss": "^0.6.9",
82-
"tailwindcss": "^3.4.17",
82+
"prettier-plugin-tailwindcss": "^0.7.2",
83+
"tailwindcss": "^4.1.18",
8384
"typescript": "^5.7.2",
8485
"vite": "^5.4.11",
8586
"vite-tsconfig-paths": "^5.1.4",

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
}

src/App.css

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,92 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
3+
@plugin 'tailwindcss-animate';
4+
5+
@source './**/*.{ts,tsx}';
6+
7+
@custom-variant dark (&:is(.dark *));
8+
9+
@utility container {
10+
margin-inline: auto;
11+
padding-inline: 2rem;
12+
@media (width >= --theme(--breakpoint-sm)) {
13+
max-width: none;
14+
}
15+
@media (width >= 1400px) {
16+
max-width: 1400px;
17+
}
18+
}
19+
20+
@theme {
21+
--color-border: hsl(var(--border));
22+
--color-input: hsl(var(--input));
23+
--color-ring: hsl(var(--ring));
24+
--color-background: hsl(var(--background));
25+
--color-foreground: hsl(var(--foreground));
26+
27+
--color-primary: hsl(var(--primary));
28+
--color-primary-foreground: hsl(var(--primary-foreground));
29+
30+
--color-secondary: hsl(var(--secondary));
31+
--color-secondary-foreground: hsl(var(--secondary-foreground));
32+
33+
--color-destructive: hsl(var(--destructive));
34+
--color-destructive-foreground: hsl(var(--destructive-foreground));
35+
36+
--color-muted: hsl(var(--muted));
37+
--color-muted-foreground: hsl(var(--muted-foreground));
38+
39+
--color-accent: hsl(var(--accent));
40+
--color-accent-foreground: hsl(var(--accent-foreground));
41+
42+
--color-popover: hsl(var(--popover));
43+
--color-popover-foreground: hsl(var(--popover-foreground));
44+
45+
--color-card: hsl(var(--card));
46+
--color-card-foreground: hsl(var(--card-foreground));
47+
48+
--radius-lg: var(--radius);
49+
--radius-md: calc(var(--radius) - 2px);
50+
--radius-sm: calc(var(--radius) - 4px);
51+
52+
--animate-accordion-down: accordion-down 0.2s ease-out;
53+
--animate-accordion-up: accordion-up 0.2s ease-out;
54+
55+
@keyframes accordion-down {
56+
from {
57+
height: 0;
58+
}
59+
to {
60+
height: var(--radix-accordion-content-height);
61+
}
62+
}
63+
@keyframes accordion-up {
64+
from {
65+
height: var(--radix-accordion-content-height);
66+
}
67+
to {
68+
height: 0;
69+
}
70+
}
71+
}
72+
73+
/*
74+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
75+
so we've added these compatibility styles to make sure everything still
76+
looks the same as it did with Tailwind CSS v3.
77+
78+
If we ever want to remove these styles, we need to add an explicit border
79+
color utility to any element that depends on these defaults.
80+
*/
81+
@layer base {
82+
*,
83+
::after,
84+
::before,
85+
::backdrop,
86+
::file-selector-button {
87+
border-color: var(--color-gray-200, currentcolor);
88+
}
89+
}
490

591
@layer base {
692
:root {

src/components/custom/coockie-consent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function CookieConsent({ demo, onAcceptCallback, onDeclineCallbac
5555
return (
5656
<div
5757
className={cn(
58-
'fixed bottom-0 left-0 right-0 z-[200] w-full transition-transform duration-700 sm:bottom-4 sm:left-4 sm:max-w-md',
58+
'fixed bottom-0 left-0 right-0 z-200 w-full transition-transform duration-700 sm:bottom-4 sm:left-4 sm:max-w-md',
5959
!isOpen
6060
? 'translate-y-8 opacity-0 transition-[opacity,transform]'
6161
: 'translate-y-0 opacity-100 transition-[opacity,transform]',

src/components/custom/multiple-selector.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
379379
<Badge
380380
key={option.value}
381381
className={cn(
382-
'data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground',
383-
'data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground',
382+
'data-disabled:bg-muted-foreground data-disabled:text-muted data-disabled:hover:bg-muted-foreground',
383+
'data-fixed:bg-muted-foreground data-fixed:text-muted data-fixed:hover:bg-muted-foreground',
384384
badgeClassName
385385
)}
386386
data-fixed={option.fixed}
@@ -389,7 +389,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
389389
{option.label}
390390
<button
391391
className={cn(
392-
'ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2',
392+
'ml-1 rounded-full outline-hidden ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2',
393393
(disabled || option.fixed) && 'hidden'
394394
)}
395395
onKeyDown={(e) => {
@@ -431,7 +431,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
431431
}}
432432
placeholder={hidePlaceholderWhenSelected && selected.length !== 0 ? '' : placeholder}
433433
className={cn(
434-
'flex-1 bg-transparent outline-none placeholder:text-muted-foreground',
434+
'flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground',
435435
{
436436
'w-full': hidePlaceholderWhenSelected,
437437
'px-3 py-2': selected.length === 0,
@@ -457,7 +457,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
457457
</div>
458458
<div className="relative">
459459
{open && (
460-
<CommandList className="absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in">
460+
<CommandList className="absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-hidden animate-in">
461461
{isLoading ? (
462462
<>{loadingIndicator}</>
463463
) : (

src/components/ui/badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority"
44
import { cn } from "@/lib/utils"
55

66
const badgeVariants = cva(
7-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
7+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
88
{
99
variants: {
1010
variant: {

src/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
55
import { cn } from "@/lib/utils"
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
99
{
1010
variants: {
1111
variant: {

src/components/ui/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Card = React.forwardRef<
99
<div
1010
ref={ref}
1111
className={cn(
12-
"rounded-lg border bg-card text-card-foreground shadow-sm",
12+
"rounded-lg border bg-card text-card-foreground shadow-xs",
1313
className
1414
)}
1515
{...props}

0 commit comments

Comments
 (0)