Skip to content

Commit 529b2cf

Browse files
committed
feat(app): color and corner tokens that read in both themes
Light-theme muted, ok, warn and danger get darker so every text color reads at 4.5:1 on canvas, panel and sunken; the accent stays as a fill and words in it use the new accent-text. Dialog scrim and the close button's red become tokens, rounded-md folds into 8 px, and ui/tokens.test.ts checks the contrast of every text token in both themes. Spec 15.3 lists the tokens.
1 parent 03ae424 commit 529b2cf

19 files changed

Lines changed: 98 additions & 29 deletions

‎app/src/features/bots/ChiefBadge.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function ChiefBadge({ crew, compact = false }: { crew: Crew; compact?: bo
2020
return (
2121
<span
2222
title={c.hint(crew.name)}
23-
className="inline-flex shrink-0 items-center gap-1 rounded-full bg-accent/10 px-2 py-0.5 font-medium text-accent text-xs"
23+
className="inline-flex shrink-0 items-center gap-1 rounded-full bg-accent/10 px-2 py-0.5 font-medium text-accent-text text-xs"
2424
>
2525
<Crown aria-hidden size={12} />
2626
{c.badge}

‎app/src/features/chat/EffortPicker.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function EffortPicker({ bot, onLater }: { bot: Bot; onLater(text: string)
140140
left: `${(at(recommended) / LAST) * 100}%`,
141141
transform: `translateX(${EDGE[at(recommended)] ?? "-50%"})`,
142142
}}
143-
className="absolute top-2.5 whitespace-nowrap text-[0.6875rem] text-accent"
143+
className="absolute top-2.5 whitespace-nowrap text-[0.6875rem] text-accent-text"
144144
>
145145
{m.recommended}
146146
</span>
@@ -170,7 +170,7 @@ export function EffortPicker({ bot, onLater }: { bot: Bot; onLater(text: string)
170170
pending.current = null;
171171
void set("default", recommended ? m.names[recommended] : m.recommended);
172172
}}
173-
className="shrink-0 rounded-md px-1.5 py-0.5 font-medium text-ink-soft text-xs hover:bg-sunken hover:text-ink"
173+
className="shrink-0 rounded-lg px-1.5 py-0.5 font-medium text-ink-soft text-xs hover:bg-sunken hover:text-ink"
174174
>
175175
{m.useRecommended}
176176
</button>

‎app/src/features/chat/InboundRow.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function TaskTag({ message }: { message: Message }) {
4949
);
5050
if (message.kind === "routine") {
5151
return (
52-
<span className="inline-flex items-center gap-1 rounded-md border border-accent/40 px-1.5 text-accent text-xs">
52+
<span className="inline-flex items-center gap-1 rounded-lg border border-accent/40 px-1.5 text-accent-text text-xs">
5353
<AlarmClock aria-hidden size={11} />
5454
{t.routines.tag(routine?.name ?? t.routines.tab)}
5555
</span>
@@ -60,7 +60,7 @@ function TaskTag({ message }: { message: Message }) {
6060
}
6161
const Icon = message.kind === "task" ? ListTodo : Reply;
6262
return (
63-
<span className="inline-flex items-center gap-1 rounded-md border border-line px-1.5 text-muted text-xs">
63+
<span className="inline-flex items-center gap-1 rounded-lg border border-line px-1.5 text-muted text-xs">
6464
<Icon aria-hidden size={11} />
6565
{message.kind === "task" ? t.chat.inbound.task : t.chat.inbound.result}
6666
</span>

‎app/src/features/chat/ModePicker.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function ModePicker({ bot, onLater }: { bot: Bot; onLater(text: string):
9191
}
9292
}}
9393
trailing={
94-
<span className="shrink-0 rounded-md border border-danger/50 px-2 py-0.5 font-medium text-danger text-xs">
94+
<span className="shrink-0 rounded-lg border border-danger/50 px-2 py-0.5 font-medium text-danger text-xs">
9595
{m.turnOn}
9696
</span>
9797
}

‎app/src/features/chat/ToolLines.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function ToolLine({ tool, createdAt }: { tool: ToolItem; createdAt: number }) {
134134
title={t.files.showInPanel}
135135
aria-label={`${t.files.showInPanel}: ${tool.summary}`}
136136
onClick={() => showFile(tool.file as string)}
137-
className="grid size-6 shrink-0 place-items-center rounded-md text-muted transition-colors hover:bg-sunken hover:text-ink"
137+
className="grid size-6 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-sunken hover:text-ink"
138138
>
139139
<Files aria-hidden size={14} />
140140
</button>
@@ -145,7 +145,7 @@ function ToolLine({ tool, createdAt }: { tool: ToolItem; createdAt: number }) {
145145
title={t.screens.showInPanel}
146146
aria-label={`${t.screens.showInPanel}: ${tool.summary}`}
147147
onClick={() => showScreen(tool.file as string)}
148-
className="grid size-6 shrink-0 place-items-center rounded-md text-muted transition-colors hover:bg-sunken hover:text-ink"
148+
className="grid size-6 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-sunken hover:text-ink"
149149
>
150150
<LayoutTemplate aria-hidden size={14} />
151151
</button>
@@ -156,7 +156,7 @@ function ToolLine({ tool, createdAt }: { tool: ToolItem; createdAt: number }) {
156156
title={t.browser.showInPanel}
157157
aria-label={`${t.browser.showInPanel}: ${title}`}
158158
onClick={() => showBrowser()}
159-
className="grid size-6 shrink-0 place-items-center rounded-md text-muted transition-colors hover:bg-sunken hover:text-ink"
159+
className="grid size-6 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-sunken hover:text-ink"
160160
>
161161
<Globe aria-hidden size={14} />
162162
</button>

‎app/src/features/crews/CrewView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function CrewView({ crew }: { crew: Crew }) {
7979
type="button"
8080
onClick={openFolder}
8181
title={words.openFolder}
82-
className="flex min-w-0 items-center gap-1 rounded-md px-1 hover:bg-sunken hover:text-ink"
82+
className="flex min-w-0 items-center gap-1 rounded-lg px-1 hover:bg-sunken hover:text-ink"
8383
>
8484
<Folder aria-hidden size={13} className="shrink-0" />
8585
<span className="truncate">{words.folder(crew.workFolder)}</span>

‎app/src/features/crews/Sidebar.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function Sidebar() {
4141
aria-current={overview ? "page" : undefined}
4242
title={words.showAll}
4343
onClick={() => selectCrew(null)}
44-
className={`rounded-md px-2 py-1 font-semibold text-xs uppercase tracking-[0.12em] transition-colors hover:bg-sunken hover:text-ink ${overview ? "bg-sunken text-ink" : "text-muted"}`}
44+
className={`rounded-lg px-2 py-1 font-semibold text-xs uppercase tracking-[0.12em] transition-colors hover:bg-sunken hover:text-ink ${overview ? "bg-sunken text-ink" : "text-muted"}`}
4545
>
4646
{words.label}
4747
</button>
@@ -98,7 +98,7 @@ function CrewEntry({ crew }: { crew: Crew }) {
9898
aria-label={collapsed ? words.expand(crew.name) : words.collapse(crew.name)}
9999
title={collapsed ? words.expand(crew.name) : words.collapse(crew.name)}
100100
onClick={() => setCollapsed(crew.id, !collapsed)}
101-
className="absolute left-1 z-10 grid size-6 place-items-center rounded-md text-muted hover:bg-line hover:text-ink"
101+
className="absolute left-1 z-10 grid size-6 place-items-center rounded-lg text-muted hover:bg-line hover:text-ink"
102102
>
103103
<ChevronDown
104104
aria-hidden
@@ -179,7 +179,7 @@ const Conversation = memo(function Conversation({ bot, crew }: { bot: Bot; crew:
179179
</span>
180180
{activity && (
181181
<time
182-
className={`shrink-0 text-xs ${unread ? "font-semibold text-accent" : "text-muted"}`}
182+
className={`shrink-0 text-xs ${unread ? "font-semibold text-accent-text" : "text-muted"}`}
183183
dateTime={new Date(activity.at).toISOString()}
184184
>
185185
{when(activity.at)}

‎app/src/features/messages/MessageRow.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function TaskTag({ message, task }: { message: Message; task: Task | undefined }
5757
: text.taskStatus[task.status];
5858
}
5959
return (
60-
<span className="inline-flex items-center gap-1 rounded-md border border-line px-1.5 text-muted text-xs">
60+
<span className="inline-flex items-center gap-1 rounded-lg border border-line px-1.5 text-muted text-xs">
6161
<Icon aria-hidden size={11} />
6262
{message.kind === "task" ? text.task : text.result}
6363
{detail && <span>· {detail}</span>}

‎app/src/features/routines/ScheduleFields.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function ScheduleFields({
6060
onClick={() => toggleDay(day)}
6161
className={`grid h-8 w-10 place-items-center rounded-lg border text-sm transition-colors ${
6262
on
63-
? "border-accent bg-accent/12 font-medium text-accent"
63+
? "border-accent bg-accent/12 font-medium text-accent-text"
6464
: "border-line-strong text-ink-soft hover:bg-sunken"
6565
}`}
6666
>

‎app/src/features/screens/ScreenFocus.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function ScreenFocus({
6060
title={t.devices[one]}
6161
aria-label={t.devices[one]}
6262
onClick={() => onDevice(one)}
63-
className={`grid size-7 place-items-center rounded-md transition-colors ${
63+
className={`grid size-7 place-items-center rounded-lg transition-colors ${
6464
one === device ? "bg-panel text-ink shadow-sm" : "text-muted hover:text-ink"
6565
}`}
6666
>
@@ -85,7 +85,7 @@ export function ScreenFocus({
8585
/>
8686
</div>
8787
<div ref={stage} className="design-board min-h-0 flex-1 overflow-auto p-4">
88-
<div className="mx-auto w-fit overflow-hidden rounded-md shadow-lift ring-1 ring-line">
88+
<div className="mx-auto w-fit overflow-hidden rounded-lg shadow-lift ring-1 ring-line">
8989
<LiveFrame
9090
url={screen.url}
9191
device={device}

0 commit comments

Comments
 (0)