Skip to content

Commit 7823ead

Browse files
committed
fix(webapp): carry light high-contrast on radio borders instead of backgrounds
1 parent 4c73f79 commit 7823ead

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

apps/webapp/app/components/primitives/RadioButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ const variants = {
2222
},
2323
"button/small": {
2424
button:
25-
"flex items-center w-fit h-8 pl-2 pr-3 rounded-md border border-border-bright/50 shadow-xs bg-background-bright transition hover:bg-surface-hover-subtle data-disabled:opacity-70 data-disabled:hover:bg-background-bright hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:bg-surface-selected",
25+
"flex items-center w-fit h-8 pl-2 pr-3 rounded-md border border-border-bright/50 shadow-xs bg-background-bright transition hover:bg-surface-hover-subtle data-disabled:opacity-70 data-disabled:hover:bg-background-bright hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:border-border-selected data-[state=checked]:bg-surface-selected",
2626
label: "text-sm text-text-bright select-none",
2727
description: "text-text-dimmed",
2828
inputPosition: "mt-0",
2929
icon: "w-8 h-8 mb-2",
3030
},
3131
button: {
3232
button:
33-
"w-fit py-2 pl-3 pr-4 rounded border border-border-bright/50 shadow-xs bg-background-bright hover:bg-surface-hover-subtle transition hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:bg-surface-selected data-disabled:opacity-70",
33+
"w-fit py-2 pl-3 pr-4 rounded border border-border-bright/50 shadow-xs bg-background-bright hover:bg-surface-hover-subtle transition hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:border-border-selected data-[state=checked]:bg-surface-selected data-disabled:opacity-70",
3434
label: "text-text-bright select-none",
3535
description: "text-text-dimmed",
3636
inputPosition: "mt-1",
3737
icon: "w-8 h-8 mb-2",
3838
},
3939
description: {
4040
button:
41-
"w-full p-2.5 rounded-md border border-border-bright/50 shadow-xs bg-background-bright transition hover:bg-surface-hover-subtle data-disabled:opacity-70 hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:bg-surface-selected",
41+
"w-full p-2.5 rounded-md border border-border-bright/50 shadow-xs bg-background-bright transition hover:bg-surface-hover-subtle data-disabled:opacity-70 hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:border-border-selected data-[state=checked]:bg-surface-selected",
4242
label: "text-text-bright font-semibold -mt-0.5 text-left text-sm",
4343
description: "text-text-dimmed mt-0 text-left",
4444
inputPosition: "mt-0",
4545
icon: "w-8 h-8 mb-2",
4646
},
4747
icon: {
4848
button:
49-
"w-full p-2.5 pb-4 rounded-sm border border-border-bright/50 shadow-xs bg-background-bright hover:bg-surface-hover-subtle transition data-disabled:opacity-70 hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:bg-surface-selected",
49+
"w-full p-2.5 pb-4 rounded-sm border border-border-bright/50 shadow-xs bg-background-bright hover:bg-surface-hover-subtle transition data-disabled:opacity-70 hover:data-[state=checked]:bg-surface-selected-hover data-[state=checked]:border-border-selected data-[state=checked]:bg-surface-selected",
5050
label: "text-text-bright font-semibold -mt-1 text-left",
5151
description: "text-text-dimmed mt-0 text-left",
5252
inputPosition: "mt-0",

apps/webapp/app/tailwind.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@
166166
/* Borders, from subtlest to most visible */
167167
--color-grid-dimmed: var(--color-charcoal-750);
168168
--color-grid-bright: var(--color-charcoal-700);
169+
/* Blend of border-bright over the selected card, so it tracks whatever ramp
170+
border-bright is on - the dark themes need no contrast entry of their own */
171+
--color-border-selected: color-mix(in srgb, var(--color-border-bright) 50%, var(--color-surface-selected));
169172
--color-border-bright: var(--color-charcoal-600);
170173
--color-border-brighter: var(--color-charcoal-550);
171174
--color-border-brightest: var(--color-charcoal-500);
@@ -783,6 +786,7 @@
783786
/* Borders */
784787
--color-grid-dimmed: #eceef1;
785788
--color-grid-bright: #e2e4e9;
789+
--color-border-selected: #e0e2e6;
786790
--color-border-bright: #d2d5db;
787791
--color-border-brighter: #b9bdc7;
788792
--color-border-brightest: #9ba1ad;
@@ -965,21 +969,20 @@
965969
page-behind surfaces darken a touch so panels separate */
966970
--color-background-deep: color-mix(in srgb, #f1f2f4, #000 calc(var(--theme-contrast, 0) * 10%));
967971
--color-background-hover: color-mix(in srgb, #f2f3f5, #000 calc(var(--theme-contrast, 0) * 8%));
968-
/* Radio card surface - shallow ramp, see surface-selected below */
969-
--color-surface-hover-subtle: color-mix(in srgb, #f7f8f9, #000 calc(var(--theme-contrast, 0) * 4%));
972+
/* Radio card surfaces take no ramp at all on white - their contrast is
973+
carried by border-selected below. Deliberately absent: surface-hover-subtle,
974+
surface-selected, surface-selected-hover. */
970975
--color-background-raised: color-mix(in srgb, #e9eaee, #000 calc(var(--theme-contrast, 0) * 10%));
971976

972977
/* Controls and borders push hard toward black - this is where light-mode
973978
contrast is actually visible */
974979
--color-surface-control: color-mix(in srgb, #dcdee3, #000 calc(var(--theme-contrast, 0) * 25%));
975980
--color-surface-control-hover: color-mix(in srgb, #cfd2d9, #000 calc(var(--theme-contrast, 0) * 28%));
976981
--color-surface-control-active: color-mix(in srgb, #b8bcc6, #000 calc(var(--theme-contrast, 0) * 32%));
977-
/* Selection marks state, it is not a filled control: the radio trio keeps a
978-
shallow ramp so the cards stay light even at full contrast */
979-
--color-surface-selected: color-mix(in srgb, #eff0f2, #000 calc(var(--theme-contrast, 0) * 6%));
980-
--color-surface-selected-hover: color-mix(in srgb, #e7e9ec, #000 calc(var(--theme-contrast, 0) * 8%));
981982
--color-grid-dimmed: color-mix(in srgb, #eceef1, #000 calc(var(--theme-contrast, 0) * 28%));
982983
--color-grid-bright: color-mix(in srgb, #e2e4e9, #000 calc(var(--theme-contrast, 0) * 32%));
984+
/* Steeper than border-bright so the selected card stays the loudest edge */
985+
--color-border-selected: color-mix(in srgb, #e0e2e6, #000 calc(var(--theme-contrast, 0) * 45%));
983986
--color-border-bright: color-mix(in srgb, #d2d5db, #000 calc(var(--theme-contrast, 0) * 38%));
984987
--color-border-brighter: color-mix(in srgb, #b9bdc7, #000 calc(var(--theme-contrast, 0) * 42%));
985988
--color-border-brightest: color-mix(in srgb, #9ba1ad, #000 calc(var(--theme-contrast, 0) * 46%));

0 commit comments

Comments
 (0)