Skip to content

Commit 8effb70

Browse files
authored
feat(chore): migrate to tailwindcss4 #1521 (#1522)
1 parent e2c50b5 commit 8effb70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+769
-679
lines changed

package-lock.json

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

webapp/app/globals.css

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
3+
@config '../tailwind.config.mjs';
4+
5+
/*
6+
The default border color has changed to `currentColor` in Tailwind CSS v4,
7+
so we've added these compatibility styles to make sure everything still
8+
looks the same as it did with Tailwind CSS v3.
9+
10+
If we ever want to remove these styles, we need to add an explicit border
11+
color utility to any element that depends on these defaults.
12+
*/
13+
@layer base {
14+
*,
15+
::after,
16+
::before,
17+
::backdrop,
18+
::file-selector-button {
19+
border-color: var(--color-gray-200, currentColor);
20+
}
21+
}
422

523
/* https://ui.shadcn.com/themes */
624
@layer base {

webapp/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
109109
}
110110

111111
return (
112-
<div className="flex h-screen w-full select-none overflow-hidden">
112+
<div className="flex h-screen w-full overflow-hidden select-none">
113113
<TooltipProvider>
114114
<Sidebar />
115115
<div className="flex grow flex-col">

webapp/components/common/ButtonCard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function ButtonCard({
3030
const container = (
3131
<div className="flex h-full w-full flex-col gap-2 p-4">
3232
<div className={`${cssTitle}min-h-[24px] w-full text-xl font-bold`}>{title}</div>
33-
<div className={`${cssDesc}aspect-[4/3] text-base text-secondary-foreground`}>
33+
<div className={`${cssDesc}aspect-4/3 text-secondary-foreground text-base`}>
3434
<p className="line-clamp-4">{description}</p>
3535
</div>
3636
</div>
@@ -50,7 +50,7 @@ export default function ButtonCard({
5050
onClick={disabled ? undefined : onClick}
5151
className={`${
5252
selected ? `${cname} border-2` : `${cname}`
53-
} m-2 h-full w-full overflow-hidden rounded bg-muted`}
53+
} bg-muted m-2 h-full w-full overflow-hidden rounded`}
5454
>
5555
{container}
5656
</div>

webapp/components/common/ContentView/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function Header({ header, toolbar }: ToolbarProps) {
3737

3838
return (
3939
<div
40-
className="flex h-11 w-full flex-row items-center justify-between gap-1 bg-secondary/70 p-2 text-sm"
40+
className="bg-secondary/70 flex h-11 w-full flex-row items-center justify-between gap-1 p-2 text-sm"
4141
data-tauri-drag-region={isTitlebarTransparent}
4242
>
4343
<div

webapp/components/common/ContentView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function ContentView({
3333
}: ContentViewProps) {
3434
// const { t } = useTranslation();
3535
return (
36-
<div className={cn('flex h-full flex-col bg-secondary/20', className)}>
36+
<div className={cn('bg-secondary/20 flex h-full flex-col', className)}>
3737
{(header || toolbar) && <Header header={header || selectedId || ''} toolbar={toolbar} />}
3838
{children}
3939
</div>

webapp/components/common/EmptyView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function EmptyView({
7373
<div className="mx-auto flex max-w-[420px] flex-col items-center justify-center text-center">
7474
{icon}
7575
<h3 className="mt-4 text-lg font-extrabold">{title}</h3>
76-
<p className="mb-4 mt-2 text-sm text-muted-foreground">{description}</p>
76+
<p className="text-muted-foreground mt-2 mb-4 text-sm">{description}</p>
7777
{buttonLabel && <Button onClick={onCreateItem}>{buttonLabel}</Button>}
7878
{actions && (
7979
<div className="flex gap-2">{actions.map((action) => renderAction(action))}</div>

webapp/components/common/Explorer/ExplorerGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function ExplorerGroup({
4949
strokeWidth={1.5}
5050
/>
5151
</Button>
52-
<div className="flex w-full flex-grow items-center justify-between gap-1 overflow-hidden p-0 pl-2">
52+
<div className="flex w-full grow items-center justify-between gap-1 overflow-hidden p-0 pl-2">
5353
{typeof title === 'string' && (
54-
<div className="line-clamp-1 text-ellipsis break-all text-sm capitalize text-muted-foreground">
54+
<div className="text-muted-foreground line-clamp-1 text-sm break-all text-ellipsis capitalize">
5555
{t(title)}
5656
</div>
5757
)}

webapp/components/common/Explorer/ExplorerList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function ExplorerList<T>({
9292
<ScrollArea className="h-full">
9393
<ul
9494
className={cn(
95-
'flex flex-col break-all rounded-md px-1 py-3 text-sm dark:border-white/20',
95+
'flex flex-col rounded-md px-1 py-3 text-sm break-all dark:border-white/20',
9696
className,
9797
)}
9898
>
@@ -103,7 +103,7 @@ export default function ExplorerList<T>({
103103
key={`${item.id}-${item.name}`}
104104
className={cn(
105105
selectedId === item.id ? 'text-foreground' : 'text-muted-foreground',
106-
'rounded-md px-2 py-2 transition-colors duration-200 hover:bg-foreground/10',
106+
'hover:bg-foreground/10 rounded-md px-2 py-2 transition-colors duration-200',
107107
)}
108108
>
109109
{menuItems && menuItems.length > 0 ? (

webapp/components/common/Explorer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function Explorer({
4747

4848
const isTitlebarTransparent = isMac();
4949
return (
50-
<div className="flex h-full w-full flex-1 items-start border-r-[1px] bg-secondary/70">
50+
<div className="bg-secondary/70 flex h-full w-full flex-1 items-start border-r-[1px]">
5151
<nav className="flex h-full flex-1 flex-col">
5252
<div className="flex w-full items-center">
5353
<div

0 commit comments

Comments
 (0)