Open source CapCut alternative.
TypeScript
fix(site): keep file tiles light in dark mode
David Le51d77c7294f2
diff --git a/.claude/skills/ui-quality/references/checks.md b/.claude/skills/ui-quality/references/checks.mdindex c62da26b..65500eea 100644--- a/.claude/skills/ui-quality/references/checks.md+++ b/.claude/skills/ui-quality/references/checks.md@@ -8,7 +8,7 @@ The site theme lives in [globals.css](../../../../site/src/app/globals.css). `baThe root uses the system preference until an explicit `.light` or `.dark` theme is set. Product `.app-surface` pages select `--app-background`, while public light pages use the sand background. Cold-load both kinds of surface. Check explicit light on a dark system and explicit dark on a light system when touching theme selection; exercise a preference change while the page is open.-`ink`, `cream`, and `coral` are fixed brand colors. Pair fixed pastel cards with their intended ink. A `light` element and everything inside it keep the light tokens and skip `dark:` utilities. Note paper is one: the open note, its tiles, and its menus look the same in both themes.+`ink`, `cream`, and `coral` are fixed brand colors. Pair fixed pastel cards with their intended ink. A `light` element and everything inside it keep the light tokens and skip `dark:` utilities. Files are light elements: note paper, its menus, and every file tile look the same in both themes, and only the chrome around them goes dark.A dark-mode change leaves light mode pixel-identical. Keep the light value and add the dark one beside it, as in `text-[#454545] dark:text-foreground/70`.diff --git a/site/src/cut/components/LibraryCard.tsx b/site/src/cut/components/LibraryCard.tsxindex 4687ee8c..018ca470 100644--- a/site/src/cut/components/LibraryCard.tsx+++ b/site/src/cut/components/LibraryCard.tsx@@ -59,7 +59,9 @@ export function libraryTileBox(: { w: 1, h: 1 };return {className: cn(- "relative max-w-full overflow-hidden rounded-xl border shadow-sm",+ // `light`: a file looks the same in both themes; only the chrome around+ // it goes dark.+ "light relative max-w-full overflow-hidden rounded-xl border shadow-sm",type === "lut" ? "bg-background" : "bg-muted",!area && (font ? "aspect-[16/7]" : "aspect-square"),// The sheet is the card, so nothing is drawn around it; the typediff --git a/site/src/cut/components/SidePanel.tsx b/site/src/cut/components/SidePanel.tsxindex 3e62843b..d2e022df 100644--- a/site/src/cut/components/SidePanel.tsx+++ b/site/src/cut/components/SidePanel.tsx@@ -1513,7 +1513,8 @@ function AssetCard({ref={tileRef}data-drag-objectclassName={cn(- "relative aspect-square overflow-hidden rounded-xl border border-border bg-muted shadow-sm transition-colors group-hover:border-input",+ // A file looks the same in both themes, like the Library's.+ "light relative aspect-square overflow-hidden rounded-xl border border-border bg-muted shadow-sm transition-colors group-hover:border-input",(flash || selected) && PICKED_RING)}>diff --git a/site/src/cut/components/TemplateCard.tsx b/site/src/cut/components/TemplateCard.tsxindex c2fadb05..07b12fbd 100644--- a/site/src/cut/components/TemplateCard.tsx+++ b/site/src/cut/components/TemplateCard.tsx@@ -198,7 +198,8 @@ export function TemplateCard({data-sel-id={selectId}style={typeof tile === "number" ? { width: tile, height: tile } : undefined}className={cn(- "group flex flex-col border bg-background",+ // A template is a file: it looks the same in both themes.+ "light group flex flex-col border bg-background text-foreground",tile ? "relative overflow-hidden rounded-xl p-2.5 shadow-sm" : "rounded-lg px-2.5 py-1.5",tile === "fill" && "aspect-square w-full",selected ? PICKED_RING : "border-border",diff --git a/site/src/cut/components/editor-mock/MockSidePanel.tsx b/site/src/cut/components/editor-mock/MockSidePanel.tsxindex 9def8cfd..ded540c7 100644--- a/site/src/cut/components/editor-mock/MockSidePanel.tsx+++ b/site/src/cut/components/editor-mock/MockSidePanel.tsx@@ -138,7 +138,7 @@ function MediaPanel({ panel }: { panel: Extract<MockPanel, { tab: "media" }> })function TemplateRow({ template }: { template: MockTemplate }) {return (- <div className="flex items-center gap-2 rounded-lg border border-border bg-background px-2.5 py-1.5">+ <div className="light flex items-center gap-2 rounded-lg border border-border bg-background px-2.5 py-1.5 text-foreground"><Layers className="size-3.5 shrink-0 text-violet-500" /><div className="min-w-0 flex-1"><div className="truncate text-[12px] font-medium">{template.name}</div>@@ -154,7 +154,7 @@ function TemplateRow({ template }: { template: MockTemplate }) {function MediaCard({ item }: { item: MockMediaItem }) {return (<div className="flex flex-col gap-1.5 text-left">- <div className="relative aspect-square overflow-hidden rounded-lg border border-border bg-muted">+ <div className="light relative aspect-square overflow-hidden rounded-lg border border-border bg-muted">{item.kind === "audio" ? (<AudioFace item={item} />) : (