Skip to content

Commit 7956faa

Browse files
upgrade tailwindcss to v4 (#1940) [no ci]
1 parent 4311d0e commit 7956faa

File tree

10 files changed

+579
-524
lines changed

10 files changed

+579
-524
lines changed

pnpm-lock.yaml

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

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@
4545
},
4646
"devDependencies": {
4747
"@0no-co/graphqlsp": "^1.12.16",
48+
"@tailwindcss/postcss": "^4.0.0",
4849
"@tanstack/router-cli": "1.97.25",
4950
"@tanstack/router-vite-plugin": "1.97.25",
5051
"@types/react": "^19.0.0",
5152
"@types/react-dom": "^19.0.0",
5253
"@types/semver": "^7.5.8",
5354
"@vitejs/plugin-react": "^4.3.4",
54-
"autoprefixer": "^10.4.20",
5555
"postcss": "^8.4.49",
5656
"rimraf": "^6.0.1",
57-
"tailwindcss": "^3.4.15",
57+
"tailwindcss": "^4.0.0",
5858
"typescript": "^5.7.2",
5959
"vite": "^6.0.2"
6060
}

website/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
};

website/src/components/ui/button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { cn } from '@/lib/utils';
44
import { Slot } from '@radix-ui/react-slot';
55

66
const buttonVariants = cva(
7-
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
7+
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
88
{
99
variants: {
1010
variant: {
11-
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
12-
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
11+
default: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',
12+
destructive: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',
1313
outline:
14-
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
15-
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
14+
'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',
15+
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
1616
ghost: 'hover:bg-accent hover:text-accent-foreground',
1717
link: 'text-primary underline-offset-4 hover:underline',
1818
},

website/src/components/ui/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
99
<input
1010
type={type}
1111
className={cn(
12-
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
12+
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
1313
className,
1414
)}
1515
ref={ref}

website/src/components/ui/select.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const SelectTrigger = React.forwardRef<
1616
<SelectPrimitive.Trigger
1717
ref={ref}
1818
className={cn(
19-
'flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
19+
'flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
2020
className,
2121
)}
2222
{...props}
@@ -108,7 +108,7 @@ const SelectItem = React.forwardRef<
108108
<SelectPrimitive.Item
109109
ref={ref}
110110
className={cn(
111-
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
111+
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50',
112112
className,
113113
)}
114114
{...props}

website/src/components/ui/textarea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
88
return (
99
<textarea
1010
className={cn(
11-
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
11+
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
1212
className,
1313
)}
1414
ref={ref}

website/src/components/ui/toast.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const ToastViewport = React.forwardRef<
1313
<ToastPrimitives.Viewport
1414
ref={ref}
1515
className={cn(
16-
'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
16+
'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
1717
className,
1818
)}
1919
{...props}
@@ -22,7 +22,7 @@ const ToastViewport = React.forwardRef<
2222
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
2323

2424
const toastVariants = cva(
25-
'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
25+
'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full',
2626
{
2727
variants: {
2828
variant: {
@@ -58,7 +58,7 @@ const ToastAction = React.forwardRef<
5858
<ToastPrimitives.Action
5959
ref={ref}
6060
className={cn(
61-
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
61+
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive',
6262
className,
6363
)}
6464
{...props}
@@ -73,7 +73,7 @@ const ToastClose = React.forwardRef<
7373
<ToastPrimitives.Close
7474
ref={ref}
7575
className={cn(
76-
'absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
76+
'absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600',
7777
className,
7878
)}
7979
toast-close=""

website/src/global.css

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

589
@layer base {
690
:root {

website/tailwind.config.js

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

0 commit comments

Comments
 (0)