Skip to content

Commit d129358

Browse files
Merge pull request #1771 from ItsEeleeya/desktop-tailwind-v4
Desktop App Tailwind 4
2 parents 38506f8 + 634a8f0 commit d129358

103 files changed

Lines changed: 1325 additions & 1029 deletions

File tree

Some content is hidden

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

apps/desktop/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@cap/utils": "workspace:*",
2020
"@cap/web-api-contract": "workspace:*",
2121
"@corvu/tooltip": "^0.2.1",
22-
"@kobalte/core": "^0.13.7",
22+
"@kobalte/core": "^0.13.11",
2323
"@radix-ui/colors": "^3.0.0",
2424
"@rive-app/canvas": "^2.32.2",
2525
"@solid-primitives/bounds": "^0.0.122",
@@ -75,13 +75,16 @@
7575
},
7676
"devDependencies": {
7777
"@fontsource/geist-sans": "^5.0.3",
78-
"@webgpu/types": "^0.1.44",
7978
"@iconify/json": "^2.2.239",
79+
"@tailwindcss/postcss": "^4.2.2",
80+
"@tailwindcss/typography": "^0.5.9",
8081
"@tauri-apps/cli": ">=2.1.0",
8182
"@total-typescript/ts-reset": "^0.6.1",
8283
"@types/dom-webcodecs": "^0.1.11",
8384
"@types/uuid": "^9.0.8",
85+
"@webgpu/types": "^0.1.44",
8486
"cross-env": "^7.0.3",
87+
"tailwind-scrollbar": "^3.1.0",
8588
"typescript": "^5.8.3",
8689
"vite": "^6.3.5",
8790
"vite-plugin-top-level-await": "^1.4.4",

apps/desktop/postcss.config.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
module.exports = require("@cap/ui/postcss");
1+
module.exports = {
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
autoprefixer: {},
5+
},
6+
};

apps/desktop/src/components/CapErrorBoundary.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export function CapErrorBoundary(props: ParentProps) {
99
fallback={(e: Error) => {
1010
console.error(e);
1111
return (
12-
<div class="w-full h-full flex flex-col justify-center items-center bg-gray-2 border-gray-3 max-h-screen overflow-hidden transition-[border-radius] duration-200 text-[--text-secondary] gap-y-4 max-sm:gap-y-2 px-8 text-center">
12+
<div class="w-full h-full flex flex-col justify-center items-center bg-gray-2 border-gray-3 max-h-screen overflow-hidden transition-[border-radius] duration-200 text-(--text-secondary) gap-y-4 max-sm:gap-y-2 px-8 text-center">
1313
<IconCapLogo class="max-sm:size-16" />
14-
<h1 class="text-[--text-primary] text-3xl max-sm:text-xl font-bold">
14+
<h1 class="text-(--text-primary) text-3xl max-sm:text-xl font-bold">
1515
An Error Occured
1616
</h1>
1717
<p class="mb-2 max-sm:text-sm">

apps/desktop/src/components/Cropper.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ export function Cropper(
10181018
return (
10191019
<div
10201020
ref={containerRef}
1021-
class="relative w-full h-full select-none overscroll-contain focus:outline-none touch-none"
1021+
class="relative w-full h-full select-none overscroll-contain focus:outline-hidden touch-none"
10221022
style={{
10231023
cursor: cursorStyle() ?? (props.aspectRatio ? "default" : "crosshair"),
10241024
}}
@@ -1031,11 +1031,11 @@ export function Cropper(
10311031
<Transition
10321032
appear
10331033
enterActiveClass="transition-opacity duration-300 ease-in-out"
1034-
enterClass="opacity-0 blur-sm"
1034+
enterClass="opacity-0 blur-xs"
10351035
enterToClass="opacity-100 blur-none"
10361036
exitActiveClass="transition-opacity duration-300 ease-in-out"
10371037
exitClass="opacity-100 blur-none"
1038-
exitToClass="opacity-0 blur-sm"
1038+
exitToClass="opacity-0 blur-xs"
10391039
>
10401040
<Show when={props.showBounds && labelTransform()}>
10411041
{(transform) => (
@@ -1110,7 +1110,7 @@ export function Cropper(
11101110
handle.isCorner ? (
11111111
<button
11121112
type="button"
1113-
class="fixed z-50 flex h-[30px] w-[30px] focus:ring-0 outline-none"
1113+
class="fixed z-50 flex h-[30px] w-[30px] focus:ring-0 outline-hidden"
11141114
tabIndex={-1}
11151115
classList={{ "opacity-0": mouseState.drag === "overlay" }}
11161116
style={{
@@ -1136,7 +1136,7 @@ export function Cropper(
11361136
>
11371137
<svg
11381138
aria-hidden="true"
1139-
class="absolute pointer-events-none drop-shadow-sm shadow-black"
1139+
class="absolute pointer-events-none drop-shadow-xs shadow-black"
11401140
classList={{
11411141
"size-1": boundsTooSmall(),
11421142
"size-6": !boundsTooSmall(),
@@ -1172,7 +1172,7 @@ export function Cropper(
11721172
) : (
11731173
<button
11741174
type="button"
1175-
class="absolute focus:outline-none focus:ring-0 outline-none"
1175+
class="absolute focus:outline-hidden focus:ring-0 outline-hidden"
11761176
tabIndex={-1}
11771177
style={{
11781178
visibility:
@@ -1239,9 +1239,9 @@ export function Cropper(
12391239
aria-live="polite"
12401240
>
12411241
<div
1242-
class="h-[18px] w-11 rounded-full text-center text-xs text-gray-12 border border-white/70 dark:border-white/20 drop-shadow-md outline-1 outline outline-black/80"
1242+
class="h-[18px] w-11 rounded-full text-center text-xs text-gray-12 border border-white/70 dark:border-white/20 drop-shadow-md outline-1 outline-solid outline-black/80"
12431243
classList={{
1244-
"backdrop-blur-sm bg-white/50 dark:bg-black/50 dark:backdrop-brightness-90 backdrop-brightness-200":
1244+
"backdrop-blur-xs bg-white/50 dark:bg-black/50 dark:backdrop-brightness-90 backdrop-brightness-200":
12451245
props.useBackdropFilter,
12461246
"bg-gray-3 opacity-80": !props.useBackdropFilter,
12471247
}}

apps/desktop/src/components/Loader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export function AbsoluteInsetLoader() {
22
return (
33
<div class="w-full h-full flex items-center justify-center">
44
<div class="animate-spin">
5-
<IconCapLogo class="size-[4rem]" />
5+
<IconCapLogo class="size-16" />
66
</div>
77
</div>
88
);

apps/desktop/src/components/SignInButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function SignInButton(
1111
return (
1212
<Button
1313
size="md"
14-
class="flex flex-grow justify-center items-center"
14+
class="flex grow justify-center items-center"
1515
{...props}
1616
variant={signIn.isPending ? "gray" : "primary"}
1717
onClick={() => {

apps/desktop/src/components/Toggle.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { cva } from "cva";
33
import { type ComponentProps, splitProps } from "solid-js";
44

55
const toggleControlStyles = cva(
6-
"rounded-full bg-gray-6 ui-disabled:bg-gray-3 ui-checked:bg-blue-500 transition-colors outline-2 outline-offset-2 outline-blue-300",
6+
"rounded-full bg-gray-6 data-disabled:bg-gray-3 data-checked:bg-blue-500 transition-colors",
77
{
88
variants: {
99
size: {
10-
sm: "w-9 h-[1.25rem] p-[0.125rem]",
11-
md: "w-11 h-[1.5rem] p-[0.125rem]",
12-
lg: "w-14 h-[1.75rem] p-[0.1875rem]",
10+
sm: "w-9 h-5 p-0.5",
11+
md: "w-11 h-6 p-0.5",
12+
lg: "w-14 h-7 p-0.75",
1313
},
1414
},
1515
defaultVariants: {
@@ -19,13 +19,13 @@ const toggleControlStyles = cva(
1919
);
2020

2121
const toggleThumbStyles = cva(
22-
"bg-white rounded-full transition-transform ui-checked:translate-x-[calc(100%)]",
22+
"bg-white rounded-full transition-transform data-checked:translate-x-[calc(100%)]",
2323
{
2424
variants: {
2525
size: {
26-
sm: "size-[1rem]",
27-
md: "size-[1.25rem]",
28-
lg: "size-[1.5rem]",
26+
sm: "size-4",
27+
md: "size-5",
28+
lg: "size-6",
2929
},
3030
},
3131
defaultVariants: {

apps/desktop/src/components/titlebar/Titlebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ export default function Titlebar() {
2929
>
3030
{left() ? (
3131
<>
32-
<WindowControls class="!ml-0" />
33-
<div class="!ml-auto">{titlebarState.items}</div>
32+
<WindowControls class="ml-0!" />
33+
<div class="ml-auto!">{titlebarState.items}</div>
3434
</>
3535
) : (
3636
<>
3737
{titlebarState.items}
38-
<WindowControls class="!ml-auto" />
38+
<WindowControls class="ml-auto!" />
3939
</>
4040
)}
4141
</header>

apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function (
3434
return (
3535
<div
3636
class={cx(
37-
"flex flex-row items-stretch h-full align-baseline cursor-default rounded-none select-none *:outline-none *:transition-all *:duration-200",
37+
"flex flex-row items-stretch h-full align-baseline cursor-default rounded-none select-none *:outline-hidden *:transition-all *:duration-200",
3838
local.class,
3939
focused()
4040
? "*:text-black-transparent-80"

apps/desktop/src/entry-server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default createHandler(() => (
2323
{assets}
2424
</head>
2525
<body class="w-screen h-screen cursor-default select-none">
26-
<div id="app" class="h-full text-[--text-primary]">
26+
<div id="app" class="h-full text-(--text-primary)">
2727
{children}
2828
</div>
2929
{scripts}

0 commit comments

Comments
 (0)