Skip to content

Commit d67ca80

Browse files
committed
fix(web): darken neutral control surfaces
1 parent 2d156a8 commit d67ca80

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

‎apps/web/src/components/chat/ComposerSurface.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Shell({
1515
className={cn(
1616
"group/composer-surface relative isolate mx-auto w-full max-w-3xl",
1717
"[--chat-composer-drawer-inset:1.375rem] [--chat-composer-glass-surface:var(--card)] [--chat-composer-outline:rgb(0_0_0/8%)]",
18-
"dark:[--chat-composer-glass-surface:color-mix(in_srgb,var(--background)_96%,var(--color-white))] dark:[--chat-composer-highlight:rgb(255_255_255/3%)] dark:[--chat-composer-outline:color-mix(in_srgb,var(--color-white)_5%,transparent)]",
18+
"dark:[--chat-composer-glass-surface:var(--surface-raised)] dark:[--chat-composer-highlight:rgb(255_255_255/3%)] dark:[--chat-composer-outline:color-mix(in_srgb,var(--color-white)_5%,transparent)]",
1919
"[html[data-theme-id]_&]:[--chat-composer-glass-surface:var(--app-theme-surface-raised)] [html[data-theme-id]_&]:[--chat-composer-outline:var(--app-theme-toolbar-border)]",
2020
"dark:[html[data-theme-id]:not([data-theme-id=t3-chat])_&]:[--chat-composer-highlight:color-mix(in_srgb,var(--app-theme-input)_12%,transparent)] dark:[html[data-theme-id]:not([data-theme-id=t3-chat])_&]:[--chat-composer-outline:color-mix(in_srgb,var(--app-theme-input)_30%,var(--background))]",
2121
"dark:[html[data-theme-id=t3-chat]_&]:[--chat-composer-highlight:color-mix(in_srgb,#432d48_12%,transparent)] dark:[html[data-theme-id=t3-chat]_&]:[--chat-composer-outline:#241e28]",
@@ -86,7 +86,7 @@ function ContextStrip({ className, ...props }: ComponentProps<"div">) {
8686
className={cn(
8787
"group/composer-context relative isolate mx-auto -mt-4 flex w-[calc(100%-2*var(--chat-composer-drawer-inset))] items-center gap-2 overflow-x-clip overflow-y-visible ps-1 pe-2 pt-5 pb-1",
8888
"before:absolute before:inset-0 before:-z-1 before:rounded-b-[16px] before:border before:border-(--chat-composer-outline) before:mask-[linear-gradient(to_bottom,transparent_0_1rem,black_1rem)] before:shadow-[0_12px_28px_-18px_rgb(0_0_0/40%)]",
89-
"dark:before:border-white/7 dark:before:bg-[linear-gradient(to_bottom,transparent_0_1rem,rgb(0_0_0/18%)_1rem,transparent_calc(1rem+10px)),linear-gradient(rgb(255_255_255/2%),rgb(255_255_255/2%))] dark:before:shadow-[0_14px_32px_-18px_rgb(0_0_0/75%)]",
89+
"dark:before:border-white/7 dark:before:bg-[linear-gradient(to_bottom,transparent_0_1rem,rgb(0_0_0/18%)_1rem,transparent_calc(1rem+10px)),linear-gradient(rgb(255_255_255/1%),rgb(255_255_255/1%))] dark:before:shadow-[0_14px_32px_-18px_rgb(0_0_0/75%)]",
9090
"group-has-data-[composer-banner-surface=attached]/composer-surface:before:bg-[color-mix(in_srgb,var(--chat-composer-glass-surface)_var(--glass-opacity),transparent)] group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-blur-(--glass-blur) group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-saturate-(--glass-saturation)",
9191
"not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:bg-[color-mix(in_srgb,var(--chat-composer-glass-surface)_var(--glass-opacity),transparent)] not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-blur-(--glass-blur) not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-saturate-(--glass-saturation)",
9292
className,

‎apps/web/src/index.css‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -980,19 +980,19 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
980980

981981
@variant dark {
982982
color-scheme: dark;
983-
/* Keep the workspace in the same neutral-black family as sidebar v2.
984-
Surfaces lift from this base instead of starting from a milky gray. */
983+
/* Keep controls and floating surfaces close to the neutral-black canvas.
984+
Borders and hover states provide separation without milky gray fills. */
985985
--background: var(--color-neutral-950);
986-
--surface-raised: var(--secondary);
986+
--surface-raised: color-mix(in srgb, var(--background) 97%, var(--color-white));
987987
--foreground: var(--color-neutral-100);
988-
--card: color-mix(in srgb, var(--background) 97%, var(--color-white));
988+
--card: color-mix(in srgb, var(--background) 98%, var(--color-white));
989989
--card-foreground: var(--color-neutral-100);
990-
--popover: color-mix(in srgb, var(--background) 94%, var(--color-white));
990+
--popover: color-mix(in srgb, var(--background) 97%, var(--color-white));
991991
--popover-foreground: var(--color-neutral-100);
992992
--primary: oklch(0.571 0.21 264);
993-
--secondary: --alpha(var(--color-white) / 4%);
993+
--secondary: --alpha(var(--color-white) / 3%);
994994
--secondary-foreground: var(--color-neutral-100);
995-
--muted: --alpha(var(--color-white) / 4%);
995+
--muted: --alpha(var(--color-white) / 3%);
996996
--muted-foreground: color-mix(in srgb, var(--color-neutral-500) 90%, var(--color-white));
997997
--accent: --alpha(var(--color-white) / 4%);
998998
--accent-foreground: var(--color-neutral-100);

‎apps/web/src/themePalette.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
getThemePreferenceMode,
1212
isKnownThemePreference,
1313
getCustomThemes,
14+
getStandardThemeColors,
1415
getStoredCustomThemeCollection,
1516
invalidateCustomThemes,
1617
installCustomTheme,
@@ -134,6 +135,19 @@ describe("theme files", () => {
134135
expect(asHex(dark.error)).not.toBe(asHex(darkDefaults.error));
135136
});
136137

138+
it("keeps stock dark controls in the neutral-black surface hierarchy", () => {
139+
expectThemeColors(getStandardThemeColors("dark"), {
140+
canvas: "#0a0a0a",
141+
surface: "#0f0f0f",
142+
surfaceRaised: "#111111",
143+
surfaceOverlay: "#111111",
144+
toolbarControl: "#111111",
145+
secondary: "#111111",
146+
muted: "#111111",
147+
accentSurface: "#141414",
148+
});
149+
});
150+
137151
it("derives readable, distinctive vivid palettes from exact seeds", () => {
138152
const seeds: ReadonlyArray<["light" | "dark", string, string]> = [
139153
["light", "#f4f9f2", "#1d8a4e"],

‎apps/web/src/themePalette.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,22 +402,22 @@ const T3_CODE_DARK_THEME_COLORS: ThemeColors = {
402402
toolbar: "#0a0a0a",
403403
toolbarForeground: "#f5f5f5",
404404
toolbarBorder: "#191919",
405-
toolbarControl: "#191919",
405+
toolbarControl: "#111111",
406406
toolbarControlForeground: "#f5f5f5",
407407
toolbarControlHover: "#141414",
408-
surface: "#111111",
409-
surfaceRaised: "#141414",
410-
surfaceOverlay: "#191919",
408+
surface: "#0f0f0f",
409+
surfaceRaised: "#111111",
410+
surfaceOverlay: "#111111",
411411
text: "#f5f5f5",
412412
textMuted: "#818181",
413413
border: "#191919",
414414
input: "#1e1e1e",
415415
focus: "#346bf1",
416416
accent: "#346bf1",
417417
accentForeground: "#ffffff",
418-
secondary: "#141414",
418+
secondary: "#111111",
419419
secondaryForeground: "#f5f5f5",
420-
muted: "#141414",
420+
muted: "#111111",
421421
mutedForeground: "#818181",
422422
placeholder: "#818181",
423423
secondaryLabel: "#818181",

0 commit comments

Comments
 (0)