Skip to content

Commit 59dbe5b

Browse files
samejrclaude
andcommitted
fix(webapp): keep light's surfaces distinct and soften its grid lines
Two things were wrong at high contrast in light. The side menu and title bar (background-bright) and the page behind them (background-dimmed) sit 0.035 luminance apart at contrast 0, and equal step counts closed that to 0.005 by 100% - the two read as one colour exactly when the user asked for more definition. The scale is unevenly spaced up here, so counting stops was the wrong measure. Destinations now come from a luminance target instead, roughly 0.13 per tier, which keeps every gap and widens the one that matters: bright stays above dimmed all the way, 0.035 -> 0.046. The whole stack also lands darker than before, so the slider does more. Grid lines went all the way to charcoal-400, which read as ruled paper over a table. They divide rows rather than outline anything, so they now stop a tier short of the borders: 1.65:1 against the page at full contrast where they were 2.8:1, still legible but no longer the loudest thing on screen. Contrast 0 is untouched, the stack stays monotonic at 0/50/100%, and White still pins all six surfaces flat. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent cef20b9 commit 59dbe5b

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

apps/webapp/app/tailwind.css

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,20 +1057,30 @@
10571057
--color-text-dimmed: color-mix(in srgb, var(--color-charcoal-500), var(--color-charcoal-600) calc(var(--theme-contrast, 0) * 100%));
10581058
--color-text-faint: color-mix(in srgb, var(--color-charcoal-400), var(--color-charcoal-500) calc(var(--theme-contrast, 0) * 100%));
10591059

1060-
/* Surfaces, mirroring the dark side: the whole stack translates two stops
1061-
together, so the gaps between the tiers are the same at both ends of the
1062-
slider. Dark deepens away from its light text; light has nowhere brighter to
1063-
go than the white it already sits on, so it deepens too - which is what buys
1064-
panel separation here rather than text contrast.
1060+
/* Surfaces. Light has nowhere brighter to go than the white it already sits
1061+
on, so the whole stack deepens - which is what buys panel separation here
1062+
rather than text contrast.
1063+
1064+
Destinations are chosen by LUMINANCE, not by counting stops. The scale is
1065+
unevenly spaced up here, so equal step counts squeezed the two surfaces that
1066+
matter most: background-bright (the side menu and title bar) and
1067+
background-dimmed (the page) sit 0.042 apart at contrast 0, and equal steps
1068+
closed that to 0.005 by 100% - the two read as one colour exactly when the
1069+
user asked for more definition. Each tier now drops about 0.13 luminance, so
1070+
the gaps survive the trip and bright stays clearly above dimmed:
1071+
1072+
bright 1.000 -> 0.862 dimmed 0.958 -> 0.822 (gap 0.042 -> 0.040)
1073+
hover 0.890 -> 0.780 deep 0.885 -> 0.740
1074+
raised 0.822 -> 0.693
10651075
10661076
These stay among light's own pale greys: charcoal has nothing between c-100
10671077
and c-200 to hold them. White pins all six afterwards, so it stays flat. */
1068-
--color-background-bright: color-mix(in srgb, #ffffff, #f2f3f5 calc(var(--theme-contrast, 0) * 100%));
1069-
--color-background-dimmed: color-mix(in srgb, #fbfbfc, #f1f2f4 calc(var(--theme-contrast, 0) * 100%));
1070-
--color-background-hover: color-mix(in srgb, #f2f3f5, #eef0f3 calc(var(--theme-contrast, 0) * 100%));
1071-
--color-background-deep: color-mix(in srgb, #f1f2f4, #eceef1 calc(var(--theme-contrast, 0) * 100%));
1072-
--color-background-raised: color-mix(in srgb, #e9eaee, #e2e4e9 calc(var(--theme-contrast, 0) * 100%));
1073-
--color-input-bg: color-mix(in srgb, #ffffff, #f2f3f5 calc(var(--theme-contrast, 0) * 100%));
1078+
--color-background-bright: color-mix(in srgb, #ffffff, #eef0f3 calc(var(--theme-contrast, 0) * 100%));
1079+
--color-background-dimmed: color-mix(in srgb, #fbfbfc, #e9eaee calc(var(--theme-contrast, 0) * 100%));
1080+
--color-background-hover: color-mix(in srgb, #f2f3f5, #e2e4e9 calc(var(--theme-contrast, 0) * 100%));
1081+
--color-background-deep: color-mix(in srgb, #f1f2f4, #dcdee3 calc(var(--theme-contrast, 0) * 100%));
1082+
--color-background-raised: color-mix(in srgb, #e9eaee, var(--color-charcoal-200) calc(var(--theme-contrast, 0) * 100%));
1083+
--color-input-bg: color-mix(in srgb, #ffffff, #eef0f3 calc(var(--theme-contrast, 0) * 100%));
10741084

10751085
/* Controls, grid lines and borders push down onto the charcoal stops - this is
10761086
where light-mode contrast is actually visible, and where mixing toward #000
@@ -1079,8 +1089,12 @@
10791089
--color-surface-control: color-mix(in srgb, #dcdee3, var(--color-charcoal-300) calc(var(--theme-contrast, 0) * 100%));
10801090
--color-surface-control-hover: color-mix(in srgb, #cfd2d9, var(--color-charcoal-400) calc(var(--theme-contrast, 0) * 100%));
10811091
--color-surface-control-active: color-mix(in srgb, #b8bcc6, var(--color-charcoal-500) calc(var(--theme-contrast, 0) * 100%));
1082-
--color-grid-dimmed: color-mix(in srgb, #eceef1, var(--color-charcoal-300) calc(var(--theme-contrast, 0) * 100%));
1083-
--color-grid-bright: color-mix(in srgb, #e2e4e9, var(--color-charcoal-400) calc(var(--theme-contrast, 0) * 100%));
1092+
/* Grid lines stop a tier short of where the controls and borders end up. They
1093+
divide rows and sections rather than outlining anything, so at full contrast
1094+
charcoal-400 read as ruled paper; these land soft but still legible against
1095+
the page (grid-bright 1.65:1, grid-dimmed 1.25:1 at 100%). */
1096+
--color-grid-dimmed: color-mix(in srgb, #eceef1, #cfd2d9 calc(var(--theme-contrast, 0) * 100%));
1097+
--color-grid-bright: color-mix(in srgb, #e2e4e9, var(--color-charcoal-300) calc(var(--theme-contrast, 0) * 100%));
10841098
--color-border-bright: color-mix(in srgb, #d2d5db, var(--color-charcoal-400) calc(var(--theme-contrast, 0) * 100%));
10851099
--color-border-brighter: color-mix(in srgb, #b9bdc7, var(--color-charcoal-500) calc(var(--theme-contrast, 0) * 100%));
10861100
--color-border-brightest: color-mix(in srgb, #9ba1ad, var(--color-charcoal-550) calc(var(--theme-contrast, 0) * 100%));

0 commit comments

Comments
 (0)