Skip to content

Commit 71302fe

Browse files
committed
upgrade to tailwind v4
1 parent 38c04c2 commit 71302fe

File tree

11 files changed

+417
-404
lines changed

11 files changed

+417
-404
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"devDependencies": {
6161
"@eslint/eslintrc": "^3.2.0",
6262
"@eslint/js": "^9.18.0",
63+
"@tailwindcss/postcss": "^4.0.12",
6364
"@tailwindcss/typography": "^0.5.16",
6465
"@tanstack/eslint-plugin-query": "^5.62.16",
6566
"@types/node": "^22.10.7",
@@ -77,8 +78,8 @@
7778
"onchange": "^7.1.0",
7879
"postcss": "^8.5.1",
7980
"prettier": "^3.4.2",
80-
"prettier-plugin-tailwindcss": "^0.6.10",
81-
"tailwindcss": "^3.4.17",
81+
"prettier-plugin-tailwindcss": "^0.6.11",
82+
"tailwindcss": "^4.0.12",
8283
"typedoc": "^0.27.6",
8384
"typedoc-github-theme": "^0.2.1",
8485
"typedoc-plugin-markdown": "^4.4.1",

pnpm-lock.yaml

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

postcss.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type {import('postcss-load-config').Config} */
22
const config = {
33
plugins: {
4-
tailwindcss: {},
4+
'@tailwindcss/postcss': {},
55
},
66
};
77

src/components/section/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function Header() {
2121
const router = useRouter();
2222
const { data: session } = useSession();
2323
return (
24-
<div className="sticky top-0 z-50 bg-white/75 shadow backdrop-blur">
24+
<div className="sticky top-0 z-50 bg-white/75 shadow-sm backdrop-blur-sm">
2525
<div className="container mx-auto flex h-12 items-center justify-between">
2626
<Home.Link>
2727
<Logo className="h-full w-auto py-3" />

src/components/ui/button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ 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 gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8+
"inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
99
{
1010
variants: {
1111
variant: {
1212
default:
13-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
13+
"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
1414
destructive:
15-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
15+
"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
1616
outline:
17-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
17+
"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
1818
secondary:
19-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
19+
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
2020
ghost: "hover:bg-accent hover:text-accent-foreground",
2121
link: "text-primary underline-offset-4 hover:underline",
2222
},

src/components/ui/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Card = (
1313
) => (<div
1414
ref={ref}
1515
className={cn(
16-
"rounded-xl border bg-card text-card-foreground shadow",
16+
"rounded-xl border bg-card text-card-foreground shadow-sm",
1717
className,
1818
)}
1919
{...props}

src/components/ui/dropdown-menu.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const DropdownMenuSubTrigger = (
2929
) => (<DropdownMenuPrimitive.SubTrigger
3030
ref={ref}
3131
className={cn(
32-
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
32+
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
3333
inset && "pl-8",
3434
className,
3535
)}
@@ -93,7 +93,7 @@ const DropdownMenuItem = (
9393
) => (<DropdownMenuPrimitive.Item
9494
ref={ref}
9595
className={cn(
96-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
96+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
9797
inset && "pl-8",
9898
className,
9999
)}
@@ -114,7 +114,7 @@ const DropdownMenuCheckboxItem = (
114114
) => (<DropdownMenuPrimitive.CheckboxItem
115115
ref={ref}
116116
className={cn(
117-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
117+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
118118
className,
119119
)}
120120
checked={checked}
@@ -142,7 +142,7 @@ const DropdownMenuRadioItem = (
142142
) => (<DropdownMenuPrimitive.RadioItem
143143
ref={ref}
144144
className={cn(
145-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
145+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
146146
className,
147147
)}
148148
{...props}

src/components/ui/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Input = (
1616
<input
1717
type={type}
1818
className={cn(
19-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
19+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
2020
className,
2121
)}
2222
ref={ref}

src/components/ui/toast.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const ToastViewport = (
2020
) => (<ToastPrimitives.Viewport
2121
ref={ref}
2222
className={cn(
23-
"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]",
23+
"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]",
2424
className,
2525
)}
2626
{...props}
2727
/>);
2828
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
2929

3030
const toastVariants = cva(
31-
"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",
31+
"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",
3232
{
3333
variants: {
3434
variant: {
@@ -72,7 +72,7 @@ const ToastAction = (
7272
) => (<ToastPrimitives.Action
7373
ref={ref}
7474
className={cn(
75-
"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",
75+
"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",
7676
className,
7777
)}
7878
{...props}
@@ -90,7 +90,7 @@ const ToastClose = (
9090
) => (<ToastPrimitives.Close
9191
ref={ref}
9292
className={cn(
93-
"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",
93+
"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",
9494
className,
9595
)}
9696
toast-close=""

src/styles/globals.css

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,75 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
42

5-
body {
6-
font-family: Arial, Helvetica, sans-serif;
3+
@plugin '@tailwindcss/typography';
4+
@plugin 'tailwindcss-animate';
5+
6+
@custom-variant dark (&:is(.dark *));
7+
8+
@theme {
9+
--font-raleway: var(--font-r-sans);
10+
--font-raleway-italic: var(--font-r-sans-italic);
11+
12+
--color-background: hsl(var(--background));
13+
--color-foreground: hsl(var(--foreground));
14+
15+
--color-card: hsl(var(--card));
16+
--color-card-foreground: hsl(var(--card-foreground));
17+
18+
--color-popover: hsl(var(--popover));
19+
--color-popover-foreground: hsl(var(--popover-foreground));
20+
21+
--color-primary: hsl(var(--primary));
22+
--color-primary-foreground: hsl(var(--primary-foreground));
23+
24+
--color-secondary: hsl(var(--secondary));
25+
--color-secondary-foreground: hsl(var(--secondary-foreground));
26+
27+
--color-muted: hsl(var(--muted));
28+
--color-muted-foreground: hsl(var(--muted-foreground));
29+
30+
--color-accent: hsl(var(--accent));
31+
--color-accent-foreground: hsl(var(--accent-foreground));
32+
33+
--color-destructive: hsl(var(--destructive));
34+
--color-destructive-foreground: hsl(var(--destructive-foreground));
35+
36+
--color-border: hsl(var(--border));
37+
--color-input: hsl(var(--input));
38+
--color-ring: hsl(var(--ring));
39+
40+
--color-chart-1: hsl(var(--chart-1));
41+
--color-chart-2: hsl(var(--chart-2));
42+
--color-chart-3: hsl(var(--chart-3));
43+
--color-chart-4: hsl(var(--chart-4));
44+
--color-chart-5: hsl(var(--chart-5));
45+
46+
--radius-lg: var(--radius);
47+
--radius-md: calc(var(--radius) - 2px);
48+
--radius-sm: calc(var(--radius) - 4px);
49+
}
50+
51+
/*
52+
The default border color has changed to `currentColor` in Tailwind CSS v4,
53+
so we've added these compatibility styles to make sure everything still
54+
looks the same as it did with Tailwind CSS v3.
55+
56+
If we ever want to remove these styles, we need to add an explicit border
57+
color utility to any element that depends on these defaults.
58+
*/
59+
@layer base {
60+
*,
61+
::after,
62+
::before,
63+
::backdrop,
64+
::file-selector-button {
65+
border-color: var(--color-gray-200, currentColor);
66+
}
67+
}
68+
69+
@layer utilities {
70+
body {
71+
font-family: Arial, Helvetica, sans-serif;
72+
}
773
}
874

975
@layer base {

0 commit comments

Comments
 (0)