forge
Explore
Log in

Don't you dare go Hollow

🎨 colored text reaches WCAG AA contrast

Browse files at this commit

9f9eebfcbf60eb7130ada34b03400eefa274b745Burak BoduroğluParent: 8433af2
  • fix
    • 🎨 colored text reaches WCAG AA contrast
Show full message
fix: 🎨 colored text reaches WCAG AA contrast
- measured in light mode on the #F7F7F7 page: brand as text 2.5:1,
  warning 2.0:1, success 3.1:1, destructive 4.2:1 (AA needs 4.5:1)
- new text tokens primary/success/warning/info/destructive-text: darker in
  light mode, equal to the fills in dark mode; fills stay as they are
- light primary text is --brand-ink, or for a custom palette color the
  darkest-needed step of its hue (accentTextLightness, tested across hues)
- every text-{primary,success,warning,info,destructive} utility moves to
  its -text token (253 uses); opacity variants stay decorative
- token doc records the rule

110 changed files +313 -233

docs/ui/ui-redesign-tokens.mdmodified+11 -0
@@ -31,6 +31,17 @@ Dark:
3131 Success, warning, destructive, and info remain semantic. Custom palette choice
3232 continues to override `--ui-accent`, which feeds `--primary`.
3333
34+Colored text uses the `*-text` tokens, never the fills: `text-primary-text`,
35+`text-success-text`, `text-warning-text`, `text-info-text`,
36+`text-destructive-text`. The fills (`bg-primary`, `bg-warning/10`, dots,
37+rings) keep their bright values; the text tokens are darker in light mode so
38+small text reaches WCAG AA (4.5:1) on the `#F7F7F7` page and white cards —
39+the brand fill as text measured 2.5:1 and warning 2.0:1. Light-mode primary
40+text is `--brand-ink`, or for a custom palette color the darkest-needed step
41+of that hue (`accentTextLightness` in `preferences-context.tsx`). In dark mode
42+the text tokens equal the fills. Opacity variants like `text-primary/30` stay
43+on the fill for decoration only.
44+
3445 ## Typography
3546
3647 - UI: native system sans (`ui-sans-serif`, `system-ui`, `-apple-system`,
src/app.tsxmodified+1 -1
@@ -34,7 +34,7 @@ function RootErrorFallback(props: { error: unknown; reset: () => void }) {
3434 return (
3535 <div class="flex min-h-[var(--app-viewport)] items-center justify-center bg-background px-4">
3636 <div class="w-full max-w-[420px] space-y-5 rounded-xl border border-border-line bg-surface-base p-8 text-center shadow-[0_10px_24px_-4px_rgba(0,0,0,0.10)]">
37- <div class="mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-destructive/10 text-destructive">
37+ <div class="mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-destructive/10 text-destructive-text">
3838 <IconAlert class="h-6 w-6" />
3939 </div>
4040 <div class="space-y-2">
src/components/ai/celebi-launcher.tsxmodified+1 -1
@@ -47,7 +47,7 @@ export function CelebiLauncher() {
4747
4848 return (
4949 <section class="mx-auto flex max-w-3xl flex-col items-center gap-5 rounded-xl border border-dashed border-primary/25 bg-primary/[0.03] px-6 py-10 text-center">
50- <div class="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10 text-primary">
50+ <div class="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10 text-primary-text">
5151 <IconSparkles class="h-6 w-6" />
5252 </div>
5353 <div class="space-y-1">
src/components/ai/note-studio-panel.tsxmodified+1 -1
@@ -79,7 +79,7 @@ export function NoteStudioPanel() {
7979 when={selected()}
8080 fallback={
8181 <section class="flex min-h-44 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-primary/25 bg-primary/[0.03] px-6 py-8 text-center">
82- <div class="flex h-11 w-11 items-center justify-center rounded-full bg-primary/10 text-primary">
82+ <div class="flex h-11 w-11 items-center justify-center rounded-full bg-primary/10 text-primary-text">
8383 <IconWaveform class="h-5 w-5" />
8484 </div>
8585 <div>
src/components/appointments/book-appointment-form.tsxmodified+1 -1
@@ -66,7 +66,7 @@ export function BookAppointmentForm(props: {
6666 />
6767 </div>
6868
69- {error() && <p class="text-sm text-destructive">{error()}</p>}
69+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
7070 <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border bg-background px-5 pb-6 pt-4 sm:-mx-6 sm:px-6 sm:pb-6">
7171 <Button type="submit" class="h-10 flex-1 sm:flex-none" disabled={pending()}>
7272 {t("appointments.book")}
src/components/appointments/publish-slots-form.tsxmodified+1 -1
@@ -148,7 +148,7 @@ export function PublishSlotsForm(props: {
148148 </Show>
149149 </div>
150150
151- {error() && <p class="text-sm text-destructive">{error()}</p>}
151+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
152152 <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border bg-background px-5 pb-6 pt-4 sm:-mx-6 sm:px-6 sm:pb-6">
153153 <Button type="submit" class="h-10 flex-1 sm:flex-none" disabled={pending()}>
154154 {t("appointments.publish")}
src/components/appointments/reschedule-form.tsxmodified+1 -1
@@ -84,7 +84,7 @@ export function RescheduleForm(props: {
8484 </div>
8585 </div>
8686
87- {error() && <p class="text-sm text-destructive">{error()}</p>}
87+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
8888 <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border bg-background px-5 pb-6 pt-4 sm:-mx-6 sm:px-6 sm:pb-6">
8989 <Button type="submit" class="h-10 flex-1 sm:flex-none" disabled={pending()}>
9090 {t("appointments.reschedule")}
src/components/attendance/attendance-report-view.tsxmodified+1 -1
@@ -47,7 +47,7 @@ export function AttendanceReportView(props: { report: AttendanceReport; compact?
4747 header: t("nav.courses"),
4848 meta: { stickyLeft: true },
4949 cell: (cell) => (
50- <Link to="/courses/$id" params={{ id: cell.row.original.course.id }} class="block truncate font-medium hover:text-primary hover:underline">
50+ <Link to="/courses/$id" params={{ id: cell.row.original.course.id }} class="block truncate font-medium hover:text-primary-text hover:underline">
5151 {cell.row.original.course.title}
5252 </Link>
5353 ),
src/components/builder/builder-header.tsxmodified+1 -1
@@ -18,7 +18,7 @@ export function BuilderHeader() {
1818 return (
1919 <div class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border-line bg-surface-base px-4 py-2.5">
2020 <Link to="/builder" class="flex min-w-0 items-center gap-2 text-sm font-semibold text-text-strong">
21- <IconShieldCheck class="h-4 w-4 shrink-0 text-primary" />
21+ <IconShieldCheck class="h-4 w-4 shrink-0 text-primary-text" />
2222 <span class="truncate">{t("builder.console")}</span>
2323 </Link>
2424 <div class="flex min-w-0 items-center gap-3">
src/components/classes/blueprint-panel.tsxmodified+1 -1
@@ -166,7 +166,7 @@ export function BlueprintPanel(props: {
166166 </div>
167167
168168 <Show when={error()}>
169- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
169+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
170170 </Show>
171171
172172 <div class="flex justify-end">
src/components/courses/course-subjects-panel.tsxmodified+2 -2
@@ -122,7 +122,7 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea
122122 <Label for="subject-description">{t("form.description")}</Label>
123123 <Textarea id="subject-description" maxlength={2000} rows={3} value={description()} onInput={(event) => setDescription(event.currentTarget.value)} />
124124 </div>
125- {error() && <p class="text-sm text-destructive">{error()}</p>}
125+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
126126 <div class="flex flex-wrap gap-2">
127127 <Button type="submit" class="rounded-lg" disabled={pending()}>
128128 {editing() ? t("common.update") : t("common.create")}
@@ -158,7 +158,7 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea
158158 }}
159159 />
160160
161- {error() && <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
161+ {error() && <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
162162
163163 <Suspense fallback={<DataTableSkeleton />}>
164164 <Show when={(subjects() ?? []).length > 0} fallback={<EmptyState kind="courses" title={t("subjects.empty")} />}>
src/components/courses/course-teachers-panel.tsxmodified+1 -1
@@ -51,7 +51,7 @@ export function CourseTeachersPanel(props: {
5151 <Button
5252 variant="ghost"
5353 size="sm"
54- class="h-8 w-8 rounded-lg p-0 text-destructive hover:bg-destructive/10"
54+ class="h-8 w-8 rounded-lg p-0 text-destructive-text hover:bg-destructive/10"
5555 onClick={() => setRemoveTarget(cell.row.original)}
5656 >
5757 <IconTrash class="h-4 w-4" />
src/components/dashboard/command-search-field.tsxmodified+1 -1
@@ -22,7 +22,7 @@ export function CommandSearchField(props: { class?: string }) {
2222 )}
2323 aria-label={t("dashboard.commandCenter")}
2424 >
25- <IconSearch class="h-4 w-4 shrink-0 text-text-subtle group-hover:text-primary" />
25+ <IconSearch class="h-4 w-4 shrink-0 text-text-subtle group-hover:text-primary-text" />
2626 <span class="min-w-0 flex-1 truncate text-text-placeholder">{placeholder()}</span>
2727 <kbd class="hidden shrink-0 rounded-md border border-border/80 bg-background/80 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground sm:inline-block">
2828 Ctrl/Cmd K
src/components/events/event-form.tsxmodified+1 -1
@@ -297,7 +297,7 @@ export function EventForm(props: {
297297 </Show>
298298 </div>
299299 </div>
300- {error() && <p class="text-sm text-destructive">{error()}</p>}
300+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
301301 <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border bg-background px-5 pb-6 pt-4 sm:-mx-6 sm:px-6 sm:pb-6">
302302 <Button type="submit" class="h-10 flex-1 sm:flex-none" disabled={pending()}>
303303 {props.submitLabel ?? t("common.save")}
src/components/exams/answer-sheet-view.tsxmodified+4 -4
@@ -173,10 +173,10 @@ export function AnswerSheetView(props: { examId: string; userId: string; mode?:
173173 <p class="text-sm font-medium">{personLabelWithId(d().sheet.user)}</p>
174174 <Show when={d().sheet.answers.length > 0} fallback={<Badge variant="outline">{t("exams.notStarted")}</Badge>}>
175175 <div class="flex flex-wrap items-center gap-1.5">
176- <Badge variant="outline" class="border-success/50 bg-success/10 text-success">
176+ <Badge variant="outline" class="border-success/50 bg-success/10 text-success-text">
177177 {t("exams.answersRight")}: {sheetStats().right}
178178 </Badge>
179- <Badge variant="outline" class="border-destructive/50 bg-destructive/10 text-destructive">
179+ <Badge variant="outline" class="border-destructive/50 bg-destructive/10 text-destructive-text">
180180 {t("exams.answersWrong")}: {sheetStats().wrong}
181181 </Badge>
182182 <Badge variant="outline" class="text-muted-foreground">
@@ -203,7 +203,7 @@ export function AnswerSheetView(props: { examId: string; userId: string; mode?:
203203 <Show when={row.answer?.is_correct != null}>
204204 <Badge variant="outline" class={cn(
205205 "size-[22px] p-0 flex items-center justify-center",
206- row.answer?.is_correct ? "border-success/50 bg-success/10 text-success" : "border-destructive/50 bg-destructive/10 text-destructive",
206+ row.answer?.is_correct ? "border-success/50 bg-success/10 text-success-text" : "border-destructive/50 bg-destructive/10 text-destructive-text",
207207 )}>
208208 <Show when={row.answer?.is_correct} fallback={<IconX class="h-3 w-3" />}>
209209 <IconCheck class="h-3 w-3" />
@@ -266,7 +266,7 @@ export function AnswerSheetView(props: { examId: string; userId: string; mode?:
266266 <Badge variant="destructive" class="ml-auto text-[10px]">✗</Badge>
267267 </Show>
268268 {choice.id === row.question.correct && (
269- <Badge variant="outline" class="ml-auto border-success/50 bg-success/10 text-success text-[10px]">
269+ <Badge variant="outline" class="ml-auto border-success/50 bg-success/10 text-success-text text-[10px]">
270270 <IconCheck class="h-3 w-3" />
271271 </Badge>
272272 )}
src/components/exams/bank-question-picker.tsxmodified+3 -3
@@ -151,11 +151,11 @@ export function BankQuestionPicker(props: {
151151
152152 <div class="space-y-1.5">
153153 <Label for="bank-target-subject" class="text-xs font-semibold text-muted-foreground">
154- {t("bank.targetSubject")} <span class="text-destructive">*</span>
154+ {t("bank.targetSubject")} <span class="text-destructive-text">*</span>
155155 </Label>
156156 <Show
157157 when={props.subjects.length > 0}
158- fallback={<p class="text-xs text-destructive">{t("bank.noSubjects")}</p>}
158+ fallback={<p class="text-xs text-destructive-text">{t("bank.noSubjects")}</p>}
159159 >
160160 <Select
161161 id="bank-target-subject"
@@ -173,7 +173,7 @@ export function BankQuestionPicker(props: {
173173 </Show>
174174 </div>
175175
176- {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive">{error()}</p>}
176+ {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive-text">{error()}</p>}
177177
178178 <div class="flex flex-wrap items-center gap-2 pt-1">
179179 <Button
src/components/exams/exam-form.tsxmodified+1 -1
@@ -451,7 +451,7 @@ export function ExamForm(props: {
451451 </label>
452452 </div>
453453
454- {error() && <p class="text-sm text-destructive">{error()}</p>}
454+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
455455
456456 <div class="sticky bottom-0 -mx-5 flex flex-wrap items-center gap-2 border-t border-border-hairline bg-surface-base px-5 pb-6 pt-4 sm:-mx-6 sm:px-6 sm:pb-6">
457457 <Button type="submit" class="flex-1 rounded-lg sm:flex-none" disabled={pending()}>
src/components/exams/exam-questions-panel.tsxmodified+5 -5
@@ -307,7 +307,7 @@ export function ExamQuestionsPanel(props: {
307307 />
308308 </FormDialog>
309309
310- {error() && <p class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
310+ {error() && <p class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
311311
312312 <Suspense fallback={<PageSpinner />}>
313313 <Show
@@ -360,7 +360,7 @@ export function ExamQuestionsPanel(props: {
360360 </Badge>
361361 </Show>
362362 <Show when={isSavedToBank(q)}>
363- <Badge variant="outline" class="gap-1 border-warning/50 bg-warning/10 text-warning">
363+ <Badge variant="outline" class="gap-1 border-warning/50 bg-warning/10 text-warning-text">
364364 <IconArchive class="h-3 w-3" />
365365 {t("bank.savedToBankBadge")}
366366 </Badge>
@@ -378,7 +378,7 @@ export function ExamQuestionsPanel(props: {
378378 type="button"
379379 variant="ghost"
380380 size="sm"
381- class="h-7 w-fit text-xs text-destructive"
381+ class="h-7 w-fit text-xs text-destructive-text"
382382 disabled={imagePending() === `${q.id}:question`}
383383 onClick={() => void removeQuestionImage(q)}
384384 >
@@ -414,7 +414,7 @@ export function ExamQuestionsPanel(props: {
414414 type="button"
415415 variant="ghost"
416416 size="sm"
417- class="h-7 px-2 text-xs text-destructive"
417+ class="h-7 px-2 text-xs text-destructive-text"
418418 disabled={imagePending() === `${q.id}:choice:${choice.id}`}
419419 onClick={() => void removeChoiceImage(q, choice.id)}
420420 >
@@ -476,7 +476,7 @@ export function ExamQuestionsPanel(props: {
476476 type="button"
477477 variant="ghost"
478478 size="sm"
479- class="h-8 w-8 p-0 text-destructive"
479+ class="h-8 w-8 p-0 text-destructive-text"
480480 onClick={() => setRemoveQuestion(q)}
481481 aria-label={t("common.delete")}
482482 >
src/components/exams/exam-room-ws.tsxmodified+6 -6
@@ -448,7 +448,7 @@ export function ExamRoomWS(props: { exam: Exam }) {
448448 <Match when={att().status === "submitted"}>
449449 <div class="rounded-lg border border-info/30 bg-info/10 px-4 py-3">
450450 <div class="flex items-start gap-3">
451- <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-info" />
451+ <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-info-text" />
452452 <div class="min-w-0 space-y-1">
453453 <p class="text-sm font-semibold text-foreground">{t("attempt.submitted")}</p>
454454 <p class="text-sm text-muted-foreground">{t("attempt.closed")}</p>
@@ -487,8 +487,8 @@ export function ExamRoomWS(props: { exam: Exam }) {
487487 {(msg) => (
488488 <div class="overflow-hidden rounded-lg border border-destructive/30 bg-destructive/10">
489489 <div class="flex items-start gap-3 px-4 py-3">
490- <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-destructive" />
491- <p class="min-w-0 text-sm text-destructive">{msg()}</p>
490+ <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-destructive-text" />
491+ <p class="min-w-0 text-sm text-destructive-text">{msg()}</p>
492492 </div>
493493 </div>
494494 )}
@@ -563,7 +563,7 @@ export function ExamRoomWS(props: { exam: Exam }) {
563563 type="button"
564564 class={cn(
565565 "inline-flex h-8 items-center justify-center rounded-md border text-xs font-medium transition-colors hover:bg-accent",
566- question.answer ? "border-primary/35 bg-primary/10 text-primary hover:bg-primary/15" : "bg-background",
566+ question.answer ? "border-primary/35 bg-primary/10 text-primary-text hover:bg-primary/15" : "bg-background",
567567 activeQuestionIndex() === index() && "ring-2 ring-primary/60",
568568 )}
569569 onClick={() => setActiveQuestionIndex(index())}
@@ -876,7 +876,7 @@ function QuestionAnswerCardWS(props: {
876876 <IconUploadCloud class="h-4 w-4" />
877877 {t("exams.uploadAnswerImage")}
878878 </Button>
879- <Button type="button" variant="outline" size="sm" class="rounded-lg text-destructive hover:text-destructive" onClick={() => void props.onRemoveImage()}>
879+ <Button type="button" variant="outline" size="sm" class="rounded-lg text-destructive-text hover:text-destructive-text" onClick={() => void props.onRemoveImage()}>
880880 <IconTrash class="h-4 w-4" />
881881 {t("exams.removeDrawing")}
882882 </Button>
@@ -917,7 +917,7 @@ function QuestionAnswerCardWS(props: {
917917 </div>
918918 </Show>
919919 <Show when={saveState() === "failed"}>
920- <p class="mt-4 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
920+ <p class="mt-4 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive-text">
921921 {t("attempt.notSavedHint")}
922922 </p>
923923 </Show>
src/components/exams/grade-form.tsxmodified+1 -1
@@ -96,7 +96,7 @@ export function GradeForm(props: {
9696 {t("exams.gradeStudent")}
9797 </Button>
9898 </div>
99- {error() && <p class="text-sm text-destructive">{error()}</p>}
99+ {error() && <p class="text-sm text-destructive-text">{error()}</p>}
100100 </form>
101101
102102 <ConfirmDialog
src/components/exams/question-form.tsxmodified+3 -3
@@ -338,7 +338,7 @@ export function QuestionForm(props: {
338338 <For each={props.subjects}>{(subject) => <option value={subject.id}>{subject.name}</option>}</For>
339339 </Select>
340340 <Show when={subjectUnavailable()}>
341- <p class="mt-1 text-[11px] text-destructive">{t("questions.subjectUnavailableHelp")}</p>
341+ <p class="mt-1 text-[11px] text-destructive-text">{t("questions.subjectUnavailableHelp")}</p>
342342 </Show>
343343 </div>
344344 <div>
@@ -448,7 +448,7 @@ export function QuestionForm(props: {
448448 variant="ghost"
449449 size="sm"
450450 disabled={rows().length <= BANK_QUESTION_LIMITS.minChoices}
451- class="mt-0.5 h-6 w-6 p-0 text-muted-foreground hover:text-destructive"
451+ class="mt-0.5 h-6 w-6 p-0 text-muted-foreground hover:text-destructive-text"
452452 onClick={() => removeChoice(row().id)}
453453 aria-label={t("common.delete")}
454454 >
@@ -462,7 +462,7 @@ export function QuestionForm(props: {
462462 </div>
463463 </Show>
464464
465- {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive">{error()}</p>}
465+ {error() && <p class="rounded-sm bg-destructive/10 px-3 py-1.5 text-sm text-destructive-text">{error()}</p>}
466466
467467 <div class="flex flex-wrap items-center gap-2 pt-1">
468468 <Button type="submit" class="h-8 text-xs font-semibold" disabled={pending()}>
src/components/homework/homework-report-view.tsxmodified+1 -1
@@ -60,7 +60,7 @@ export function HomeworkReportView(props: { userId: string }) {
6060 <div class="space-y-1">
6161 <Badge variant="outline" class="rounded-full">{statusLabel(cell.row.original)}</Badge>
6262 <Show when={cell.row.original.late}>
63- <p class="text-[11px] text-destructive">{t("homework.late")}</p>
63+ <p class="text-[11px] text-destructive-text">{t("homework.late")}</p>
6464 </Show>
6565 </div>
6666 ),
src/components/homework/homework-submission-panel.tsxmodified+2 -2
@@ -171,7 +171,7 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) {
171171 <Button
172172 type="button"
173173 variant="ghost"
174- class="rounded-lg text-destructive hover:bg-destructive/10"
174+ class="rounded-lg text-destructive-text hover:bg-destructive/10"
175175 disabled={pending()}
176176 onClick={() => setWithdrawOpen(true)}
177177 >
@@ -213,7 +213,7 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) {
213213 <IconDownload class="h-3.5 w-3.5" />
214214 </Button>
215215 </a>
216- <Button type="button" size="icon" variant="ghost" class="h-7 w-7 rounded-lg text-destructive hover:text-destructive" disabled={pending()} title={t("common.delete")} onClick={() => void removeFile(file.id)}>
216+ <Button type="button" size="icon" variant="ghost" class="h-7 w-7 rounded-lg text-destructive-text hover:text-destructive-text" disabled={pending()} title={t("common.delete")} onClick={() => void removeFile(file.id)}>
217217 <IconTrash class="h-3.5 w-3.5" />
218218 </Button>
219219 </li>
src/components/insights/insight-detail.tsxmodified+5 -5
@@ -99,7 +99,7 @@ export function InsightDetail(props: { insight: StudentInsight; mode?: "full" |
9999 <section class="space-y-3">
100100 <div class="flex items-center justify-between gap-3">
101101 <div class="flex items-center gap-2">
102- <IconSparkles class="h-4 w-4 text-primary" />
102+ <IconSparkles class="h-4 w-4 text-primary-text" />
103103 <h3 class="text-sm font-semibold text-text-strong">{tx("insights.summary")}</h3>
104104 </div>
105105 <Show when={props.insight.summary}>
@@ -158,7 +158,7 @@ export function InsightDetail(props: { insight: StudentInsight; mode?: "full" |
158158 <Show when={props.mode !== "cards"}>
159159 <section class="space-y-3 border-t border-border-hairline pt-5">
160160 <div class="flex items-center gap-2">
161- <IconAlert class="h-4 w-4 text-warning" />
161+ <IconAlert class="h-4 w-4 text-warning-text" />
162162 <h3 class="text-sm font-semibold text-text-strong">{tx("insights.attention")}</h3>
163163 <Badge variant="warning" class="rounded-full">{props.insight.attention.length}</Badge>
164164 </div>
@@ -192,7 +192,7 @@ export function InsightDetail(props: { insight: StudentInsight; mode?: "full" |
192192
193193 <section class={cn("space-y-3", props.mode !== "cards" && "border-t border-border-hairline pt-5")}>
194194 <div class="flex items-center gap-2">
195- <IconSparkles class="h-4 w-4 text-primary" />
195+ <IconSparkles class="h-4 w-4 text-primary-text" />
196196 <h3 class="text-sm font-semibold text-text-strong">{tx("insights.recommendations")}</h3>
197197 <Badge variant="secondary" class="rounded-full">{props.insight.cards.length}</Badge>
198198 </div>
@@ -232,7 +232,7 @@ export function InsightDetail(props: { insight: StudentInsight; mode?: "full" |
232232 <Show when={props.mode !== "cards"}>
233233 <section class="space-y-3 border-t border-border-hairline pt-5">
234234 <div class="flex items-center gap-2">
235- <IconChart class="h-4 w-4 text-info" />
235+ <IconChart class="h-4 w-4 text-info-text" />
236236 <h3 class="text-sm font-semibold text-text-strong">{tx("insights.segments")}</h3>
237237 <Badge variant="info" class="rounded-full">{props.insight.segments.length}</Badge>
238238 </div>
@@ -274,7 +274,7 @@ export function InsightDetail(props: { insight: StudentInsight; mode?: "full" |
274274 <p class="text-[10px] text-muted-foreground">{tx("insights.overall")}</p>
275275 </div>
276276 <div class="rounded-lg bg-surface-overlay px-2 py-2">
277- <p class={cn("font-mono text-sm font-semibold", segment.contrast < 0 ? "text-destructive" : "text-success")}>
277+ <p class={cn("font-mono text-sm font-semibold", segment.contrast < 0 ? "text-destructive-text" : "text-success-text")}>
278278 {segment.contrast > 0 ? "+" : ""}{percent(segment.contrast)}
279279 </p>
280280 <p class="text-[10px] text-muted-foreground">{tx("insights.contrast")}</p>
src/components/insights/insight-run-report.tsxmodified+3 -3
@@ -125,7 +125,7 @@ function ReportDocument(props: {
125125 </For>
126126 </dl>
127127 <Show when={props.model.run.pending_students.length + props.model.run.failed_modules.length > 0}>
128- <ul class="space-y-1 text-xs text-warning">
128+ <ul class="space-y-1 text-xs text-warning-text">
129129 <Show when={pendingStudentsLine(prefs.locale(), props.model)}>
130130 {(line) => <li>{line()}</li>}
131131 </Show>
@@ -159,7 +159,7 @@ function ReportDocument(props: {
159159 <For each={props.model.modules}>
160160 {(module) => (
161161 <li>
162- <span class={module.with_data === 0 ? "text-warning" : undefined}>
162+ <span class={module.with_data === 0 ? "text-warning-text" : undefined}>
163163 {tx("moduleCovered", {
164164 label: moduleLabel(prefs.locale(), module.id),
165165 withData: module.with_data,
@@ -183,7 +183,7 @@ function ReportDocument(props: {
183183 <span class="mono tabular-nums">{props.model.totals.segments}</span>
184184 </p>
185185 <Show when={props.model.roster_error}>
186- {(message) => <p class="text-xs text-destructive">{tx("rosterFailed", { message: message() })}</p>}
186+ {(message) => <p class="text-xs text-destructive-text">{tx("rosterFailed", { message: message() })}</p>}
187187 </Show>
188188 <Show when={props.model.coverage.loaded === 0 && !props.model.roster_error}>
189189 <p class="text-xs text-muted-foreground">{tx("rosterEmpty")}</p>
src/components/insights/insight-runs-table.tsxmodified+2 -2
@@ -82,10 +82,10 @@ export function InsightRunsTable(props: { runs: InsightRun[] }) {
8282 const issueCount = run.pending_students.length + run.failed_modules.length;
8383 return (
8484 <div class="space-y-1">
85- <p class={cn("text-xs", issueCount > 0 || run.budget_exceeded ? "text-warning" : "text-muted-foreground")}>
85+ <p class={cn("text-xs", issueCount > 0 || run.budget_exceeded ? "text-warning-text" : "text-muted-foreground")}>
8686 {issueCount > 0 ? tx("insights.issueCount", { count: issueCount }) : tx("insights.noIssues")}
8787 </p>
88- {run.budget_exceeded && <p class="text-[11px] text-warning">{tx("insights.budgetExceeded")}</p>}
88+ {run.budget_exceeded && <p class="text-[11px] text-warning-text">{tx("insights.budgetExceeded")}</p>}
8989 {run.pending_students.length > 0 && (
9090 <p class="max-w-56 truncate text-[11px] text-muted-foreground" title={run.pending_students.join(", ")}>
9191 {tx("insights.pendingStudents", { count: run.pending_students.length })}
src/components/layout/celebi-markdown.tsxmodified+1 -1
@@ -116,7 +116,7 @@ function InlineSegments(props: { segments: Segment[] }) {
116116 href={(segment as { href: string }).href}
117117 target="_blank"
118118 rel="noreferrer"
119- class="underline underline-offset-2 hover:text-primary"
119+ class="underline underline-offset-2 hover:text-primary-text"
120120 >
121121 {(segment as { label: string }).label}
122122 </a>
src/components/layout/celebi-panel.tsxmodified+3 -3
@@ -342,7 +342,7 @@ export function CelebiPanel(props: { open: boolean; onOpenChange: (open: boolean
342342 <div class="flex flex-col gap-3">
343343 <For each={filteredMessages()}>
344344 {(message) => (
345- <div class={message.role === "user" ? "ml-8 rounded-lg rounded-br-sm bg-primary px-3.5 py-2.5 text-sm text-primary-foreground selection:bg-primary-foreground selection:text-primary" : "mr-6 rounded-lg rounded-bl-sm border border-border bg-card px-3.5 py-2.5 text-sm text-foreground shadow-sm"}>
345+ <div class={message.role === "user" ? "ml-8 rounded-lg rounded-br-sm bg-primary px-3.5 py-2.5 text-sm text-primary-foreground selection:bg-primary-foreground selection:text-primary-text" : "mr-6 rounded-lg rounded-bl-sm border border-border bg-card px-3.5 py-2.5 text-sm text-foreground shadow-sm"}>
346346 <Switch>
347347 <Match when={message.role === "user"}>
348348 <p class="whitespace-pre-wrap leading-6">{message.content}</p>
@@ -353,7 +353,7 @@ export function CelebiPanel(props: { open: boolean; onOpenChange: (open: boolean
353353 {/* The label stands in only until the first characters land;
354354 an answer that is still being written keeps typing. */}
355355 <Match when={message.status === "pending" && !visibleContent(message)}>
356- <span class="flex items-center gap-2 text-muted-foreground"><IconBotSquare class="h-4 w-4 text-primary" /><span class="animate-pulse"><CelebiThinkingLabel /></span></span>
356+ <span class="flex items-center gap-2 text-muted-foreground"><IconBotSquare class="h-4 w-4 text-primary-text" /><span class="animate-pulse"><CelebiThinkingLabel /></span></span>
357357 </Match>
358358 <Match when={true}>
359359 <CelebiMarkdown text={visibleContent(message)} />
@@ -370,7 +370,7 @@ export function CelebiPanel(props: { open: boolean; onOpenChange: (open: boolean
370370 </Match>
371371 </Switch>
372372 <Show when={message.role === "assistant" && message.status === "failed"}>
373- <span class="mt-2 flex items-center gap-1.5 text-xs text-destructive"><IconAlert class="h-3.5 w-3.5" />{failureMessage(message.error_code)}</span>
373+ <span class="mt-2 flex items-center gap-1.5 text-xs text-destructive-text"><IconAlert class="h-3.5 w-3.5" />{failureMessage(message.error_code)}</span>
374374 </Show>
375375 <Show when={message.role === "assistant" && message.truncated}>
376376 <p class="mt-2 text-xs text-muted-foreground">{locale() === "tr" ? "Yanıt uzunluk sınırında kısaltıldı." : "Response was shortened at the configured limit."}</p>
src/components/layout/celebi-thread-list.tsxmodified+1 -1
@@ -58,7 +58,7 @@ export function CelebiThreadList(props: {
5858 <button type="button" class="flex h-full min-h-12 w-9 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground" aria-label={t("ai.renameChat")} onClick={() => props.onRename(thread)}>
5959 <IconEdit class="h-3.5 w-3.5" />
6060 </button>
61- <button type="button" class="flex h-full min-h-12 w-9 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive" aria-label={t("ai.deleteChat")} onClick={() => props.onRemove(thread)}>
61+ <button type="button" class="flex h-full min-h-12 w-9 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive-text" aria-label={t("ai.deleteChat")} onClick={() => props.onRemove(thread)}>
6262 <IconTrash class="h-3.5 w-3.5" />
6363 </button>
6464 </li>
src/components/layout/mobile-nav-sheet.tsxmodified+2 -2
@@ -182,14 +182,14 @@ export function MobileNavSheet(props: {
182182 const active = () => current()?.id === item.id;
183183 const rowClass = () => cn(
184184 "flex w-full items-center gap-2.5 rounded-md px-3 py-1.5 text-left transition-colors active:bg-muted",
185- active() ? "text-primary" : "text-foreground",
185+ active() ? "text-primary-text" : "text-foreground",
186186 );
187187 const content = (
188188 <>
189189 <span
190190 class={cn(
191191 "inline-flex size-7 shrink-0 items-center justify-center rounded-md",
192- active() ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground",
192+ active() ? "bg-primary/10 text-primary-text" : "bg-muted text-muted-foreground",
193193 )}
194194 >
195195 <item.Icon class="h-4 w-4" />
src/components/layout/network-status-banner.tsxmodified+1 -1
@@ -29,7 +29,7 @@ export function NetworkStatusBanner() {
2929 <Show when={!online()}>
3030 <div class="flex flex-wrap items-center justify-between gap-3 border-b border-warning/30 bg-warning/10 px-4 py-2.5 text-sm sm:px-6 lg:px-4">
3131 <span class="flex min-w-0 items-center gap-2 text-text-strong">
32- <IconWifiOff class="h-4 w-4 shrink-0 text-warning" />
32+ <IconWifiOff class="h-4 w-4 shrink-0 text-warning-text" />
3333 <span class="min-w-0">
3434 <span class="font-semibold">{t("network.offlineTitle")}</span>
3535 <span class="hidden text-text-subtle sm:inline"> — {t("network.offlineDescription")}</span>
src/components/layout/notification-center.tsxmodified+3 -3
@@ -222,7 +222,7 @@ export function NotificationCenter() {
222222 <div class="flex items-center gap-2">
223223 <h3 class="text-sm font-semibold text-text-strong">{t("notifications.title")}</h3>
224224 <Show when={unreadCount() > 0}>
225- <span class="rounded-full bg-primary/15 px-2 py-0.5 font-mono text-[10px] font-bold text-primary">
225+ <span class="rounded-full bg-primary/15 px-2 py-0.5 font-mono text-[10px] font-bold text-primary-text">
226226 {unreadCount()}
227227 </span>
228228 </Show>
@@ -233,7 +233,7 @@ export function NotificationCenter() {
233233 type="button"
234234 variant="ghost"
235235 size="sm"
236- class="h-7 rounded-lg px-2 text-[11px] font-semibold text-text-subtle hover:bg-destructive/10 hover:text-destructive"
236+ class="h-7 rounded-lg px-2 text-[11px] font-semibold text-text-subtle hover:bg-destructive/10 hover:text-destructive-text"
237237 onClick={handleDismissAll}
238238 title={t("notifications.clearAll")}
239239 >
@@ -302,7 +302,7 @@ export function NotificationCenter() {
302302
303303 <button
304304 type="button"
305- class="absolute right-2 top-2.5 flex h-6 w-6 items-center justify-center rounded-md text-text-subtle/70 opacity-80 transition-all hover:bg-destructive/10 hover:text-destructive sm:opacity-0 sm:group-hover:opacity-100"
305+ class="absolute right-2 top-2.5 flex h-6 w-6 items-center justify-center rounded-md text-text-subtle/70 opacity-80 transition-all hover:bg-destructive/10 hover:text-destructive-text sm:opacity-0 sm:group-hover:opacity-100"
306306 title={t("notifications.dismiss")}
307307 onClick={(e) => handleDismissSingle(e, item.id)}
308308 >
src/components/layout/route-error.tsxmodified+1 -1
@@ -18,7 +18,7 @@ export function RouteErrorFallback(props: ErrorComponentProps) {
1818 console.error("Route render error:", props.error);
1919 return (
2020 <div role="alert" class="mx-auto flex w-full max-w-[520px] flex-col items-center gap-4 rounded-xl border border-border-line bg-surface-base px-6 py-10 text-center">
21- <span class="flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10 text-destructive">
21+ <span class="flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10 text-destructive-text">
2222 <IconAlert class="h-5 w-5" />
2323 </span>
2424 <div class="space-y-1.5">
src/components/layout/route-guard.tsxmodified+1 -1
@@ -15,7 +15,7 @@ function AccessDeniedCard() {
1515 return (
1616 <div class="flex min-h-[50vh] items-center justify-center px-4 py-16">
1717 <div class="w-full max-w-[420px] space-y-5 rounded-xl border border-border-line bg-surface-base p-8 text-center shadow-[0_10px_24px_-4px_rgba(0,0,0,0.10)]">
18- <div class="mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-warning/10 text-warning">
18+ <div class="mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-warning/10 text-warning-text">
1919 <IconLock class="h-6 w-6" />
2020 </div>
2121 <div class="space-y-2">
src/components/layout/side-nav.tsxmodified+3 -3
@@ -89,7 +89,7 @@ export function SideNav(props: {
8989 "relative flex h-[34px] items-center rounded-lg text-[13px] font-medium outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring",
9090 props.collapsed ? "mx-auto h-10 w-12 justify-center px-0" : "gap-3 px-3",
9191 active()
92- ? "bg-primary/10 text-primary"
92+ ? "bg-primary/10 text-primary-text"
9393 : "text-muted-foreground hover:bg-muted/70 hover:text-foreground",
9494 )}
9595 >
@@ -115,7 +115,7 @@ export function SideNav(props: {
115115 const linkClass = () => cn(
116116 "relative flex h-[30px] items-center gap-3 rounded-lg px-3 text-[13px] font-medium outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring",
117117 itemActive()
118- ? "bg-primary/10 text-primary"
118+ ? "bg-primary/10 text-primary-text"
119119 : "text-muted-foreground hover:bg-muted/70 hover:text-foreground",
120120 );
121121 const content = (
@@ -180,7 +180,7 @@ export function SideNav(props: {
180180 class={cn(
181181 "relative mx-auto flex h-10 w-12 items-center justify-center rounded-md outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring",
182182 active()
183- ? "bg-primary/10 text-primary"
183+ ? "bg-primary/10 text-primary-text"
184184 : "text-muted-foreground hover:bg-muted/70 hover:text-foreground",
185185 )}
186186 aria-label={t(group.labelKey)}
src/components/marks/marks-report-view.tsxmodified+4 -4
@@ -130,12 +130,12 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean
130130 {(block) => (
131131 <tr class="border-b border-border/60 last:border-0">
132132 <td class="min-w-0 p-3">
133- <Link to="/courses/$id" params={{ id: block.course.id }} class="block truncate font-medium hover:text-primary hover:underline">
133+ <Link to="/courses/$id" params={{ id: block.course.id }} class="block truncate font-medium hover:text-primary-text hover:underline">
134134 {block.course.title}
135135 </Link>
136136 </td>
137137 <td class="min-w-0 p-3 text-muted-foreground">
138- <Link to="/instances/$id" params={{ id: block.instance }} class="block truncate hover:text-primary hover:underline">
138+ <Link to="/instances/$id" params={{ id: block.instance }} class="block truncate hover:text-primary-text hover:underline">
139139 {t("instances.open")}
140140 </Link>
141141 </td>
@@ -181,10 +181,10 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean
181181 <div class="rounded-lg border border-border bg-card p-4 shadow-xs">
182182 <div class="flex flex-wrap items-center justify-between gap-3">
183183 <div class="min-w-0">
184- <Link to="/courses/$id" params={{ id: block.course.id }} class="inline-flex truncate text-sm font-semibold text-primary hover:underline">
184+ <Link to="/courses/$id" params={{ id: block.course.id }} class="inline-flex truncate text-sm font-semibold text-primary-text hover:underline">
185185 {block.course.title}
186186 </Link>
187- <Link to="/instances/$id" params={{ id: block.instance }} class="mt-0.5 block truncate text-xs text-muted-foreground hover:text-primary hover:underline">
187+ <Link to="/instances/$id" params={{ id: block.instance }} class="mt-0.5 block truncate text-xs text-muted-foreground hover:text-primary-text hover:underline">
188188 {t("instances.open")}
189189 </Link>
190190 </div>
src/components/meals/meal-menu-card.tsxmodified+1 -1
@@ -38,7 +38,7 @@ export function MealMenuCard(props: {
3838 <div class="mt-2 flex justify-end"><ComingSoonBadge /></div>
3939 <div class="mt-4 flex flex-wrap gap-1.5"><For each={props.menu.dishes}>{(dish) => <Badge variant="outline">{dish.name}</Badge>}</For></div>
4040 <Show when={conflicts().length > 0}>
41- <div class="mt-3 flex items-start gap-2 rounded-xl border border-warning/50 bg-warning/10 p-2 text-xs text-warning">
41+ <div class="mt-3 flex items-start gap-2 rounded-xl border border-warning/50 bg-warning/10 p-2 text-xs text-warning-text">
4242 <IconAlert class="mt-0.5 h-4 w-4" /><span>{props.labels.conflict}: {conflicts().join(", ")}</span>
4343 </div>
4444 </Show>
src/components/messages/gmail-compose-box.tsxmodified+3 -3
@@ -103,7 +103,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
103103 </button>
104104 <button
105105 type="button"
106- class="flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive"
106+ class="flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text"
107107 onClick={handleClose}
108108 title={t("common.cancel")}
109109 >
@@ -171,7 +171,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
171171 </div>
172172
173173 <Show when={error()}>
174- <p class="px-3 text-xs font-medium text-destructive">{error()}</p>
174+ <p class="px-3 text-xs font-medium text-destructive-text">{error()}</p>
175175 </Show>
176176
177177 {/* Gmail Bottom Action Toolbar */}
@@ -188,7 +188,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
188188
189189 <button
190190 type="button"
191- class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"
191+ class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text transition-colors"
192192 onClick={handleClose}
193193 title={t("messages.deleteDraft")}
194194 >
src/components/messages/gmail-mail-detail.tsxmodified+4 -4
@@ -193,7 +193,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
193193 <Button
194194 variant="ghost"
195195 size="sm"
196- class="h-8 rounded-lg text-xs text-destructive hover:bg-destructive/10"
196+ class="h-8 rounded-lg text-xs text-destructive-text hover:bg-destructive/10"
197197 onClick={() => props.onAction({ folder: "trash" })}
198198 title={t("messages.moveToTrash")}
199199 >
@@ -207,7 +207,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
207207 <Button
208208 variant="ghost"
209209 size="sm"
210- class="h-8 rounded-lg text-xs text-destructive hover:bg-destructive/10"
210+ class="h-8 rounded-lg text-xs text-destructive-text hover:bg-destructive/10"
211211 onClick={() => props.onAction({ delete: true })}
212212 title={t("messages.deleteForever")}
213213 >
@@ -328,7 +328,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
328328 />
329329
330330 <Show when={error()}>
331- <p class="text-xs font-medium text-destructive">{error()}</p>
331+ <p class="text-xs font-medium text-destructive-text">{error()}</p>
332332 </Show>
333333
334334 <div class="flex items-center justify-between pt-1">
@@ -344,7 +344,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
344344
345345 <button
346346 type="button"
347- class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive"
347+ class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text"
348348 onClick={() => setIsReplying(false)}
349349 title={t("common.cancel")}
350350 >
src/components/messages/gmail-mail-row.tsxmodified+3 -3
@@ -127,7 +127,7 @@ export function GmailMailRow(props: GmailMailRowProps) {
127127 <Show when={props.onTrash}>
128128 <button
129129 type="button"
130- class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"
130+ class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text transition-colors"
131131 title={props.folder === "trash" ? t("messages.restoreFromTrash") : t("messages.moveToTrash")}
132132 onClick={(e) => {
133133 e.stopPropagation();
@@ -141,14 +141,14 @@ export function GmailMailRow(props: GmailMailRowProps) {
141141 <Show when={props.onDeleteForever}>
142142 <button
143143 type="button"
144- class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"
144+ class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text transition-colors"
145145 title={t("messages.deleteForever")}
146146 onClick={(e) => {
147147 e.stopPropagation();
148148 props.onDeleteForever?.();
149149 }}
150150 >
151- <IconTrash class="h-3.5 w-3.5 text-destructive" />
151+ <IconTrash class="h-3.5 w-3.5 text-destructive-text" />
152152 </button>
153153 </Show>
154154
src/components/modules/module-catalog-grid.tsxmodified+1 -1
@@ -39,7 +39,7 @@ export function ModuleCatalogGrid(props: {
3939 <div class="flex shrink-0 gap-2">
4040 <button
4141 type="button"
42- class="rounded-md px-2 py-1 text-xs font-medium text-primary hover:bg-muted/60 disabled:opacity-50"
42+ class="rounded-md px-2 py-1 text-xs font-medium text-primary-text hover:bg-muted/60 disabled:opacity-50"
4343 disabled={props.disabled || onCount() === pkg.modules.length}
4444 onClick={() => toggle()(pkg.package, true)}
4545 >
src/components/notes/note-card.tsxmodified+2 -2
@@ -68,11 +68,11 @@ export function NoteCard(props: {
6868 <p class={cn("mt-2 line-clamp-5 flex-1 text-[13px] leading-6", excerpt() ? "text-muted-foreground" : "italic text-muted-foreground/70")}>
6969 {excerpt() || t("notes.noContent")}
7070 </p>
71- <span class="mt-3 inline-flex items-center gap-1 text-xs font-medium text-primary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">
71+ <span class="mt-3 inline-flex items-center gap-1 text-xs font-medium text-primary-text opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">
7272 {t("notes.open")}
7373 <IconChevronRight class="h-3.5 w-3.5" />
7474 </span>
75- {error() && <p class="mt-2 text-sm text-destructive">{error()}</p>}
75+ {error() && <p class="mt-2 text-sm text-destructive-text">{error()}</p>}
7676 </article>
7777
7878 <SidePanel open={editing()} onOpenChange={setEditing} title={t("common.edit")} description={props.note.title}>
src/components/notes/note-document.tsxmodified+1 -1
@@ -87,7 +87,7 @@ export function NoteDocument(props: { note?: Note }) {
8787 {status()}
8888 </span>
8989 <Show when={props.note}>
90- <Button type="button" variant="outline" size="sm" class="rounded-lg text-destructive hover:text-destructive" onClick={() => setDeleteOpen(true)}>
90+ <Button type="button" variant="outline" size="sm" class="rounded-lg text-destructive-text hover:text-destructive-text" onClick={() => setDeleteOpen(true)}>
9191 <IconTrash class="h-4 w-4" />
9292 {t("common.delete")}
9393 </Button>
src/components/notes/note-files-panel.tsxmodified+3 -3
@@ -177,13 +177,13 @@ export function NoteFilesPanel(props: {
177177 </Show>
178178 </div>
179179
180- {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
180+ {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
181181 <Show when={canManage() && atLimit()}>
182182 <p class="text-xs text-muted-foreground">{t("notes.fileLimit")}</p>
183183 </Show>
184184
185185 <Show when={files.error}>
186- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{formatApiError(files.error)}</p>
186+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{formatApiError(files.error)}</p>
187187 </Show>
188188
189189 <Suspense fallback={<PageSpinner />}>
@@ -272,7 +272,7 @@ export function NoteFilesPanel(props: {
272272 class="sm:max-w-3xl"
273273 >
274274 <Show when={error()}>
275- <p class="mb-3 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
275+ <p class="mb-3 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
276276 </Show>
277277 <Suspense fallback={<PageSpinner />}>
278278 <DrawCanvas
src/components/notes/note-form.tsxmodified+2 -2
@@ -194,7 +194,7 @@ export function NoteForm(props: {
194194 type="button"
195195 variant="ghost"
196196 size="icon"
197- class="h-8 w-8 rounded-md text-destructive hover:text-destructive"
197+ class="h-8 w-8 rounded-md text-destructive-text hover:text-destructive-text"
198198 onClick={() => setFiles((prev) => prev.filter((_, i) => i !== index()))}
199199 aria-label={t("common.delete")}
200200 >
@@ -209,7 +209,7 @@ export function NoteForm(props: {
209209 </Show>
210210
211211 {error() && (
212- <p class="rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive">
212+ <p class="rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive-text">
213213 {error()}
214214 </p>
215215 )}
src/components/notes/note-import-panel.tsxmodified+1 -1
@@ -184,7 +184,7 @@ export function NoteImportPanel(props: {
184184 </Show>
185185
186186 <Show when={error()}>
187- <p class="rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive">
187+ <p class="rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive-text">
188188 {error()}
189189 </p>
190190 </Show>
src/components/notes/note-rich-editor.tsxmodified+1 -1
@@ -195,7 +195,7 @@ export function NoteRichEditor(props: {
195195 type="button"
196196 class={cn(
197197 "flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
198- tool.active?.() && "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",
198+ tool.active?.() && "bg-primary/10 text-primary-text hover:bg-primary/15 hover:text-primary-text",
199199 )}
200200 title={tool.label()}
201201 aria-label={tool.label()}
src/components/notes/podcast-panel.tsxmodified+1 -1
@@ -152,7 +152,7 @@ export function PodcastPanel(props: { noteId: string; active?: boolean; noteTitl
152152 return (
153153 <section class="space-y-4 rounded-xl border border-border-line bg-surface-base p-4 shadow-xs">
154154 <div class="flex items-start gap-3">
155- <div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
155+ <div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-text">
156156 <IconWaveform class="h-5 w-5" />
157157 </div>
158158 <div>
src/components/rag/rag-citations.tsxmodified+1 -1
@@ -17,7 +17,7 @@ export function RagCitations(props: {
1717 {(citation) => (
1818 <li class="rounded-lg border border-border/70 bg-muted/30 px-3 py-2 text-xs">
1919 <div class="flex items-start gap-2">
20- <span class="mt-0.5 flex h-5 min-w-5 items-center justify-center rounded-md bg-primary/10 px-1 font-mono font-semibold text-primary">
20+ <span class="mt-0.5 flex h-5 min-w-5 items-center justify-center rounded-md bg-primary/10 px-1 font-mono font-semibold text-primary-text">
2121 {citation.n}
2222 </span>
2323 <div class="min-w-0 space-y-1">
src/components/rag/rag-message-row.tsxmodified+2 -2
@@ -28,7 +28,7 @@ export function RagMessageRow(props: {
2828 return (
2929 <article class={cn("flex gap-3", assistant() ? "justify-start" : "justify-end")}>
3030 <Show when={assistant()}>
31- <span class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 text-primary">
31+ <span class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 text-primary-text">
3232 <IconBotSquare class="h-4 w-4" />
3333 </span>
3434 </Show>
@@ -43,7 +43,7 @@ export function RagMessageRow(props: {
4343 <p class="animate-pulse text-muted-foreground" role="status">{props.labels.thinking}</p>
4444 </Match>
4545 <Match when={props.message.status === "failed"}>
46- <div class="flex items-start gap-2 text-destructive">
46+ <div class="flex items-start gap-2 text-destructive-text">
4747 <IconAlert class="mt-0.5 h-4 w-4 shrink-0" />
4848 <p>{failure()}</p>
4949 </div>
src/components/rag/rag-thread-list.tsxmodified+1 -1
@@ -63,7 +63,7 @@ export function RagThreadList(props: {
6363 </button>
6464 <button
6565 type="button"
66- class="flex w-9 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"
66+ class="flex w-9 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive-text"
6767 aria-label={props.labels.delete}
6868 onClick={() => props.onRemove(thread)}
6969 >
src/components/sessions/session-roll-call.tsxmodified+1 -1
@@ -144,7 +144,7 @@ export function SessionRollCall(props: {
144144 type="button"
145145 variant="ghost"
146146 size="icon"
147- class="h-10 w-10 shrink-0 text-destructive hover:bg-destructive/10"
147+ class="h-10 w-10 shrink-0 text-destructive-text hover:bg-destructive/10"
148148 aria-label={t("common.remove")}
149149 disabled={pendingUserId() != null}
150150 onClick={() => void clear(target.user.id)}
src/components/ui/alert.tsxmodified+4 -4
@@ -11,10 +11,10 @@ export function Alert(
1111 role="alert"
1212 class={cn(
1313 "relative flex min-h-[70px] w-full items-center rounded-lg border px-5 py-4 text-sm",
14- local.variant === "destructive" && "border-destructive/30 bg-destructive/10 text-destructive",
15- local.variant === "success" && "border-success/30 bg-success/10 font-medium text-success",
16- local.variant === "warning" && "border-warning/30 bg-warning/10 font-medium text-warning",
17- local.variant === "info" && "border-info/30 bg-info/10 font-medium text-info",
14+ local.variant === "destructive" && "border-destructive/30 bg-destructive/10 text-destructive-text",
15+ local.variant === "success" && "border-success/30 bg-success/10 font-medium text-success-text",
16+ local.variant === "warning" && "border-warning/30 bg-warning/10 font-medium text-warning-text",
17+ local.variant === "info" && "border-info/30 bg-info/10 font-medium text-info-text",
1818 (!local.variant || local.variant === "default") && "border-border-line bg-surface-base text-foreground",
1919 local.class,
2020 )}
src/components/ui/badge.tsxmodified+3 -3
@@ -12,9 +12,9 @@ const badgeVariants = cva(
1212 secondary: "border-transparent bg-secondary text-secondary-foreground",
1313 outline: "border-border text-foreground",
1414 destructive: "border-transparent bg-destructive/90 text-destructive-foreground",
15- success: "border-transparent bg-success/15 text-success",
16- warning: "border-transparent bg-warning/15 text-warning",
17- info: "border-transparent bg-info/15 text-info",
15+ success: "border-transparent bg-success/15 text-success-text",
16+ warning: "border-transparent bg-warning/15 text-warning-text",
17+ info: "border-transparent bg-info/15 text-info-text",
1818 },
1919 },
2020 defaultVariants: {
src/components/ui/button.tsxmodified+1 -1
@@ -15,7 +15,7 @@ export const buttonVariants = cva(
1515 "border border-border/70 bg-transparent hover:border-border hover:bg-muted/60 hover:text-foreground",
1616 secondary: "border border-border/60 bg-secondary text-secondary-foreground hover:bg-secondary/80",
1717 ghost: "text-foreground/75 hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",
18- link: "text-primary underline-offset-4 hover:underline active:scale-100",
18+ link: "text-primary-text underline-offset-4 hover:underline active:scale-100",
1919 },
2020 size: {
2121 default: "h-9 rounded-lg px-3 py-2",
src/components/ui/combobox.tsxmodified+1 -1
@@ -94,7 +94,7 @@ export function ComboboxItem<T extends ValidComponent = "li">(
9494 >
9595 {local.children}
9696 <ComboboxPrimitive.ItemIndicator>
97- <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary" />
97+ <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary-text" />
9898 </ComboboxPrimitive.ItemIndicator>
9999 </ComboboxPrimitive.Item>
100100 );
src/components/ui/confirm-dialog.tsxmodified+1 -1
@@ -64,7 +64,7 @@ export function ConfirmDialog(props: ConfirmDialogProps) {
6464 <span
6565 class={cn(
6666 "mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md border",
67- props.iconClass ?? (destructive() ? "border-destructive/20 bg-destructive/10 text-destructive" : "border-primary/20 bg-primary/10 text-primary"),
67+ props.iconClass ?? (destructive() ? "border-destructive/20 bg-destructive/10 text-destructive-text" : "border-primary/20 bg-primary/10 text-primary-text"),
6868 )}
6969 >
7070 <Show when={props.icon} fallback={
src/components/ui/date-picker.tsxmodified+1 -1
@@ -166,7 +166,7 @@ export function DatePicker(props: {
166166 type="button"
167167 class={cn(
168168 "inline-flex h-9 items-center justify-center rounded-md border border-transparent p-0 text-xs font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
169- isSameDay(today, day()) && "border-primary/50 text-primary",
169+ isSameDay(today, day()) && "border-primary/50 text-primary-text",
170170 sameDay(selected(), day()) && "border-primary bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 hover:text-primary-foreground",
171171 )}
172172 onClick={(event) => {
src/components/ui/dropdown-menu.tsxmodified+1 -1
@@ -47,7 +47,7 @@ export function DropdownMenuItem<T extends ValidComponent = "div">(
4747 "data-disabled:pointer-events-none data-disabled:opacity-40",
4848 local.inset && "pl-9",
4949 local.destructive &&
50- "text-destructive focus:bg-destructive/10 focus:text-destructive data-highlighted:bg-destructive/10 data-highlighted:text-destructive",
50+ "text-destructive-text focus:bg-destructive/10 focus:text-destructive-text data-highlighted:bg-destructive/10 data-highlighted:text-destructive-text",
5151 local.class,
5252 )}
5353 {...rest}
src/components/ui/input.tsxmodified+1 -1
@@ -25,7 +25,7 @@ export function Input(props: InputProps) {
2525 {...rest}
2626 />
2727 <Show when={local.error}>
28- <p id={errorId()} class="text-xs font-medium text-destructive">{local.error}</p>
28+ <p id={errorId()} class="text-xs font-medium text-destructive-text">{local.error}</p>
2929 </Show>
3030 </>
3131 );
src/components/ui/select.tsxmodified+4 -4
@@ -63,7 +63,7 @@ export function DropdownSelect<T extends string | number = string>(props: Dropdo
6363 <DropdownMenuItem
6464 class={cn(
6565 "flex items-center justify-between gap-2.5 text-sm",
66- isSelected() && "bg-primary/10 text-primary font-semibold",
66+ isSelected() && "bg-primary/10 text-primary-text font-semibold",
6767 )}
6868 onSelect={() => props.onChange(option.value)}
6969 >
@@ -74,7 +74,7 @@ export function DropdownSelect<T extends string | number = string>(props: Dropdo
7474 <span class="truncate">{option.label}</span>
7575 </div>
7676 <Show when={isSelected()}>
77- <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary" />
77+ <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary-text" />
7878 </Show>
7979 </DropdownMenuItem>
8080 );
@@ -168,13 +168,13 @@ export function Select(props: SelectProps) {
168168 disabled={option.disabled}
169169 class={cn(
170170 "flex items-center justify-between gap-2.5 text-sm",
171- option.value === current() && "bg-primary/10 font-semibold text-primary",
171+ option.value === current() && "bg-primary/10 font-semibold text-primary-text",
172172 )}
173173 onSelect={() => pick(option.value)}
174174 >
175175 <span class="truncate">{option.label}</span>
176176 <Show when={option.value === current()}>
177- <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary" />
177+ <IconCheck class="h-3.5 w-3.5 shrink-0 text-primary-text" />
178178 </Show>
179179 </DropdownMenuItem>
180180 )}
src/components/ui/table-row-actions.tsxmodified+2 -2
@@ -25,8 +25,8 @@ export function TableRowActions(props: { label: string; actions: TableRowAction[
2525 <DropdownMenu placement="bottom-end" gutter={6}>
2626 <DropdownMenuTrigger
2727 class={props.compact
28- ? "inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/80 bg-muted/45 text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary"
29- : "inline-flex h-8 min-w-[78px] items-center justify-center gap-1.5 rounded-lg border border-border/80 bg-muted/45 px-2 text-xs font-semibold text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary"}
28+ ? "inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/80 bg-muted/45 text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary-text focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary-text"
29+ : "inline-flex h-8 min-w-[78px] items-center justify-center gap-1.5 rounded-lg border border-border/80 bg-muted/45 px-2 text-xs font-semibold text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary-text focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary-text"}
3030 aria-label={props.label}
3131 title={props.label}
3232 >
src/components/ui/textarea.tsxmodified+1 -1
@@ -25,7 +25,7 @@ export function Textarea(props: TextareaProps) {
2525 {...rest}
2626 />
2727 <Show when={local.error}>
28- <p id={errorId()} class="text-xs font-medium text-destructive">{local.error}</p>
28+ <p id={errorId()} class="text-xs font-medium text-destructive-text">{local.error}</p>
2929 </Show>
3030 </>
3131 );
src/components/users/account-profile-dialog.tsxmodified+1 -1
@@ -28,7 +28,7 @@ export function AccountProfileDialog(props: { open: boolean; onOpenChange: (open
2828 aria-current={section() === id ? "page" : undefined}
2929 class={cn(
3030 "flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
31- section() === id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground",
31+ section() === id ? "bg-primary/10 text-primary-text" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground",
3232 )}
3333 >
3434 {icon}
src/components/users/avatar-upload.tsxmodified+1 -1
@@ -101,7 +101,7 @@ export function AvatarUpload(props: {
101101 </div>
102102
103103 <Show when={error()}>
104- <p class="max-w-40 text-xs text-destructive">{error()}</p>
104+ <p class="max-w-40 text-xs text-destructive-text">{error()}</p>
105105 </Show>
106106
107107 <input
src/components/users/badge-grid.tsxmodified+4 -4
@@ -117,7 +117,7 @@ export function BadgeGrid(props: {
117117 <div class="flex flex-wrap items-start justify-between gap-3">
118118 <div class="min-w-0">
119119 <h2 class="flex items-center gap-2 text-lg font-semibold tracking-tight text-foreground">
120- <PixelIcon name="trophy" class="h-5 w-5 text-primary" />
120+ <PixelIcon name="trophy" class="h-5 w-5 text-primary-text" />
121121 {t("badges.title")}
122122 </h2>
123123 <p class="mt-1 text-sm text-muted-foreground">{t("badges.subtitle")}</p>
@@ -156,11 +156,11 @@ export function BadgeGrid(props: {
156156 >
157157 {(n) => (
158158 <div class="flex flex-wrap items-center gap-3 rounded-lg border border-primary/25 bg-primary/5 px-4 py-3">
159- <span class="flex h-9 w-9 items-center justify-center rounded-md bg-primary/15 text-primary">
159+ <span class="flex h-9 w-9 items-center justify-center rounded-md bg-primary/15 text-primary-text">
160160 <PixelIcon name={statIcon(n().entry.stat)} class="h-5 w-5" />
161161 </span>
162162 <div class="min-w-0 flex-1">
163- <p class="text-[11px] font-medium uppercase tracking-wide text-primary">{t("badges.next")}</p>
163+ <p class="text-[11px] font-medium uppercase tracking-wide text-primary-text">{t("badges.next")}</p>
164164 <p class="truncate text-sm text-muted-foreground">{description(n().entry.id) || label(n().entry.id)}</p>
165165 </div>
166166 <div class="w-40">
@@ -188,7 +188,7 @@ export function BadgeGrid(props: {
188188 <span
189189 class={cn(
190190 "flex h-8 w-8 items-center justify-center rounded-md",
191- earnedInLadder() > 0 ? "bg-primary/12 text-primary" : "bg-muted text-muted-foreground",
191+ earnedInLadder() > 0 ? "bg-primary/12 text-primary-text" : "bg-muted text-muted-foreground",
192192 )}
193193 >
194194 <PixelIcon name={statIcon(ladder.stat)} class="h-[18px] w-[18px]" />
src/components/users/parent-students-panel.tsxmodified+2 -2
@@ -84,7 +84,7 @@ export function ParentStudentsPanel(props: {
8484 <Show when={flash()}>
8585 <Alert variant="success">{flash()}</Alert>
8686 </Show>
87- {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
87+ {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
8888
8989 <div class="flex items-end gap-2">
9090 <div class="flex-1">
@@ -137,7 +137,7 @@ export function ParentStudentsPanel(props: {
137137 <Button
138138 variant="ghost"
139139 size="icon"
140- class="shrink-0 text-destructive hover:bg-destructive/10 hover:text-destructive"
140+ class="shrink-0 text-destructive-text hover:bg-destructive/10 hover:text-destructive-text"
141141 aria-label={t("parentLink.remove")}
142142 onClick={() => setRemoving(student)}
143143 >
src/components/users/profile-form.tsxmodified+1 -1
@@ -195,7 +195,7 @@ export function ProfileForm(props: {
195195 <Label for="pf-birth">{t("profile.birthDate")}</Label>
196196 <DatePicker id="pf-birth" class="h-10" placeholder={t("form.datePlaceholder")} value={birthDate()} onChange={setBirthDate} />
197197 </div>
198- {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
198+ {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
199199 <div class="flex justify-end">
200200 <Button type="submit" class="w-full sm:w-auto" disabled={pending()}>{t("common.save")}</Button>
201201 </div>
src/components/users/profile-memberships.tsxmodified+2 -2
@@ -67,7 +67,7 @@ export function ProfileMemberships(props: {
6767 <For each={classRows()}>
6868 {(c) => (
6969 <li class="flex items-center gap-3 rounded-lg border border-border/60 px-3 py-2.5">
70- <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
70+ <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-text">
7171 <IconSchool class="h-4 w-4" />
7272 </span>
7373 <span class="min-w-0 flex-1">
@@ -118,7 +118,7 @@ export function ProfileMemberships(props: {
118118 <span
119119 class={cn(
120120 "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
121- c.kind === "club" ? "bg-violet-500/10 text-violet-600 dark:text-violet-300" : "bg-primary/10 text-primary",
121+ c.kind === "club" ? "bg-violet-500/10 text-violet-600 dark:text-violet-300" : "bg-primary/10 text-primary-text",
122122 )}
123123 >
124124 <IconBook class="h-4 w-4" />
src/components/users/user-avatar.tsxmodified+1 -1
@@ -43,7 +43,7 @@ export function UserAvatar(props: {
4343 return (
4444 <span
4545 class={cn(
46- "relative flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/15 font-bold text-primary shadow-xs ring-1 ring-border/70 dark:bg-emerald-100 dark:text-emerald-950 dark:ring-white/20",
46+ "relative flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/15 font-bold text-primary-text shadow-xs ring-1 ring-border/70 dark:bg-emerald-100 dark:text-emerald-950 dark:ring-white/20",
4747 SIZES[props.size ?? "sm"],
4848 props.class,
4949 )}
src/components/users/user-search-select.tsxmodified+1 -1
@@ -177,7 +177,7 @@ export function UserSearchSelect(props: {
177177 <p class="px-2 py-2 text-xs text-muted-foreground">{t("common.loading")}</p>
178178 </Show>
179179 <Show when={emptyText()}>
180- <p class="px-2 py-2 text-xs font-medium text-destructive">{emptyText()}</p>
180+ <p class="px-2 py-2 text-xs font-medium text-destructive-text">{emptyText()}</p>
181181 </Show>
182182 </ComboboxContent>
183183 </Combobox>
src/components/whiteboard/board-bulk-invite.tsxmodified+2 -2
@@ -103,7 +103,7 @@ export function BoardBulkInvite(props: {
103103 class={cn(
104104 "rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",
105105 kind() === k
106- ? "border-primary bg-primary/10 text-primary"
106+ ? "border-primary bg-primary/10 text-primary-text"
107107 : "border-border/70 text-muted-foreground hover:bg-muted/60",
108108 )}
109109 aria-pressed={kind() === k}
@@ -151,7 +151,7 @@ export function BoardBulkInvite(props: {
151151 <p class="text-xs text-muted-foreground">{notice()}</p>
152152 </Show>
153153 <Show when={error()}>
154- <p class="text-xs text-destructive">{error()}</p>
154+ <p class="text-xs text-destructive-text">{error()}</p>
155155 </Show>
156156 </section>
157157 );
src/components/whiteboard/whiteboard-room-ws.tsxmodified+2 -2
@@ -239,8 +239,8 @@ export function WhiteboardRoom(props: {
239239 <Show when={notice()}>
240240 {(msg) => (
241241 <div class="flex items-start gap-3 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3">
242- <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-destructive" />
243- <p class="min-w-0 text-sm text-destructive">{msg()}</p>
242+ <IconAlert class="mt-0.5 h-5 w-5 shrink-0 text-destructive-text" />
243+ <p class="min-w-0 text-sm text-destructive-text">{msg()}</p>
244244 </div>
245245 )}
246246 </Show>
src/index.cssmodified+19 -1
@@ -50,6 +50,14 @@
5050 --color-success: hsl(var(--success));
5151 --color-warning: hsl(var(--warning));
5252 --color-info: hsl(var(--info));
53+ /* Text-on-surface variants: the fills above are for buttons, dots and
54+ tints; small colored text uses these, which reach WCAG AA (4.5:1) on the
55+ page and card backgrounds in both themes. */
56+ --color-primary-text: hsl(var(--primary-text));
57+ --color-success-text: hsl(var(--success-text));
58+ --color-warning-text: hsl(var(--warning-text));
59+ --color-info-text: hsl(var(--info-text));
60+ --color-destructive-text: hsl(var(--destructive-text));
5361
5462 --color-sidebar: hsl(var(--sidebar));
5563 --color-sidebar-foreground: hsl(var(--sidebar-foreground));
@@ -395,6 +403,11 @@
395403 --success: 137 63% 39%;
396404 --warning: 38 92% 50%;
397405 --info: 219 98% 53%;
406+ --primary-text: var(--accent-light-text, var(--brand-ink));
407+ --success-text: 137 63% 30%;
408+ --warning-text: 38 92% 31%;
409+ --info-text: 219 98% 50%;
410+ --destructive-text: 356 82% 46%;
398411 --surface-elevated: 0 0% 100%;
399412 --sidebar: 0 0% 98%;
400413 --sidebar-foreground: 0 0% 8%;
@@ -446,6 +459,11 @@
446459 --success: 137 58% 58%;
447460 --warning: 38 92% 54%;
448461 --info: 219 98% 60%;
462+ --primary-text: var(--primary);
463+ --success-text: var(--success);
464+ --warning-text: var(--warning);
465+ --info-text: var(--info);
466+ --destructive-text: var(--destructive);
449467 --illu-ink: hsl(240 6% 72%);
450468 --illu-line: hsl(0 0% 30%);
451469 --illu-soft: hsl(0 0% 19%);
@@ -474,7 +492,7 @@
474492 }
475493
476494 body {
477- @apply min-h-screen bg-background font-sans text-foreground antialiased selection:bg-primary/20 selection:text-primary;
495+ @apply min-h-screen bg-background font-sans text-foreground antialiased selection:bg-primary/20 selection:text-primary-text;
478496 /* The mobile shells (Tauri on Android/iOS) draw the page edge to edge, so
479497 the status bar and the camera cutout sit on top of it. This padding is
480498 what starts the page below them; border-box keeps the min-height from
src/lib/appointment-status.tsmodified+3 -3
@@ -3,9 +3,9 @@ import type { AppointmentStatus } from "@/api/client";
33 import type { MessageKey } from "@/i18n/messages";
44
55 export function appointmentStatusClass(status: AppointmentStatus | string): string {
6- if (status === "pending") return "border-warning/30 bg-warning/10 text-warning";
7- if (status === "approved") return "border-success/30 bg-success/10 text-success";
8- if (status === "rejected") return "border-destructive/30 bg-destructive/10 text-destructive";
6+ if (status === "pending") return "border-warning/30 bg-warning/10 text-warning-text";
7+ if (status === "approved") return "border-success/30 bg-success/10 text-success-text";
8+ if (status === "rejected") return "border-destructive/30 bg-destructive/10 text-destructive-text";
99 return "border-muted bg-muted/50 text-muted-foreground";
1010 }
1111
src/lib/attendance-status.tsmodified+4 -4
@@ -6,25 +6,25 @@ export const ATTENDANCE_STATUSES: { value: CoreAttendanceStatus; key: MessageKey
66 value: "present",
77 key: "status.present",
88 detailKey: "status.presentDetail",
9- class: "border-success/30 bg-success/10 text-success",
9+ class: "border-success/30 bg-success/10 text-success-text",
1010 },
1111 {
1212 value: "absent",
1313 key: "status.absent",
1414 detailKey: "status.absentDetail",
15- class: "border-destructive/30 bg-destructive/10 text-destructive",
15+ class: "border-destructive/30 bg-destructive/10 text-destructive-text",
1616 },
1717 {
1818 value: "late",
1919 key: "status.late",
2020 detailKey: "status.lateDetail",
21- class: "border-warning/30 bg-warning/10 text-warning",
21+ class: "border-warning/30 bg-warning/10 text-warning-text",
2222 },
2323 {
2424 value: "excused",
2525 key: "status.excused",
2626 detailKey: "status.excusedDetail",
27- class: "border-info/30 bg-info/10 text-info",
27+ class: "border-info/30 bg-info/10 text-info-text",
2828 },
2929 ];
3030
src/lib/payments.tsmodified+3 -3
@@ -13,9 +13,9 @@ export type StatementStatus = {
1313 // receivables-aging colors: green current/paid, amber partial, red overdue.
1414 export function statementStatus(entry: StatementEntry): StatementStatus {
1515 if (entry.reversed) return { key: "payments.statusCancelled", class: "border-border bg-muted/40 text-muted-foreground", dot: "bg-muted-foreground/50" };
16- if (entry.outstanding_minor <= 0) return { key: "payments.paid", class: "border-success/50 bg-success/10 text-success", dot: "bg-success" };
17- if (entry.overdue) return { key: "payments.overdue", class: "border-destructive/50 bg-destructive/10 text-destructive", dot: "bg-destructive" };
18- if (entry.credited_minor > 0) return { key: "payments.statusPartial", class: "border-warning/50 bg-warning/10 text-warning", dot: "bg-warning" };
16+ if (entry.outstanding_minor <= 0) return { key: "payments.paid", class: "border-success/50 bg-success/10 text-success-text", dot: "bg-success" };
17+ if (entry.overdue) return { key: "payments.overdue", class: "border-destructive/50 bg-destructive/10 text-destructive-text", dot: "bg-destructive" };
18+ if (entry.credited_minor > 0) return { key: "payments.statusPartial", class: "border-warning/50 bg-warning/10 text-warning-text", dot: "bg-warning" };
1919 return { key: "payments.statusPending", class: "border-border bg-background/50 text-muted-foreground", dot: "bg-muted-foreground/40" };
2020 }
2121
src/lib/schedule-status.tsmodified+4 -4
@@ -11,16 +11,16 @@ export type ScheduleStatus =
1111
1212 export function scheduleStatusClass(status: ScheduleStatus | string): string {
1313 if (status === "active") {
14- return "border-info/30 bg-info/10 text-info";
14+ return "border-info/30 bg-info/10 text-info-text";
1515 }
1616 if (status === "submitted") {
17- return "border-success/30 bg-success/10 text-success";
17+ return "border-success/30 bg-success/10 text-success-text";
1818 }
1919 if (status === "today" || status === "upcoming" || status === "soon") {
20- return "border-warning/30 bg-warning/10 text-warning";
20+ return "border-warning/30 bg-warning/10 text-warning-text";
2121 }
2222 if (status === "finished" || status === "past") {
23- return "border-destructive/30 bg-destructive/10 text-destructive";
23+ return "border-destructive/30 bg-destructive/10 text-destructive-text";
2424 }
2525 return "border-muted bg-muted/50 text-muted-foreground";
2626 }
src/pages/academic-years-page.tsxmodified+1 -1
@@ -325,7 +325,7 @@ function AcademicYearsContent() {
325325 type="button"
326326 variant="ghost"
327327 size="icon"
328- class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive"
328+ class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text"
329329 aria-label={t("common.delete")}
330330 onClick={() => setPromotions((rows) => rows.filter((_, i) => i !== index()))}
331331 >
src/pages/appointments-page.tsxmodified+3 -3
@@ -245,7 +245,7 @@ function AppointmentsContent() {
245245 <div class="flex flex-col gap-0.5">
246246 {timeCell(cell.row.original.starts_at, cell.row.original.ends_at)}
247247 <Show when={hasStandingProposal(cell.row.original)}>
248- <div class="text-info text-xs">{t("appointments.rescheduleProposed")}</div>
248+ <div class="text-info-text text-xs">{t("appointments.rescheduleProposed")}</div>
249249 </Show>
250250 </div>
251251 ),
@@ -337,7 +337,7 @@ function AppointmentsContent() {
337337 `Appointment::window`), so the row's own time already shows the
338338 proposed one — label it instead of printing it twice. */}
339339 <Show when={hasStandingProposal(cell.row.original)}>
340- <div class="text-info text-xs">{t("appointments.proposedTime")}:</div>
340+ <div class="text-info-text text-xs">{t("appointments.proposedTime")}:</div>
341341 </Show>
342342 {timeCell(cell.row.original.starts_at, cell.row.original.ends_at)}
343343 </div>
@@ -472,7 +472,7 @@ function AppointmentsContent() {
472472 <Show when={nextBooking()}>
473473 {(booking) => (
474474 <div class="mb-4 flex flex-wrap items-center gap-3 rounded-xl border border-border-line bg-surface-tint p-4">
475- <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-base text-primary">
475+ <span class="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-base text-primary-text">
476476 <IconCalendarDays class="h-4 w-4" />
477477 </span>
478478 <div class="min-w-0 flex-1">
src/pages/bank-question-detail-page.tsxmodified+2 -2
@@ -151,7 +151,7 @@ function BankQuestionDetailContent() {
151151 <Button
152152 variant="outline"
153153 size="sm"
154- class="text-destructive hover:text-destructive"
154+ class="text-destructive-text hover:text-destructive-text"
155155 disabled={imagePending() === "question"}
156156 onClick={() => void removeImage("question", () => deleteBankQuestionImage(current().id))}
157157 >
@@ -180,7 +180,7 @@ function BankQuestionDetailContent() {
180180 <Button
181181 variant="ghost"
182182 size="icon"
183- class="h-8 w-8 text-destructive hover:bg-destructive/10"
183+ class="h-8 w-8 text-destructive-text hover:bg-destructive/10"
184184 aria-label={t("common.remove")}
185185 disabled={imagePending() === choice.id}
186186 onClick={() => void removeImage(choice.id, () => deleteBankChoiceImage(current().id, choice.id))}
src/pages/builder-login-page.tsxmodified+2 -2
@@ -115,14 +115,14 @@ function BuilderLoginForm() {
115115 </div>
116116 </div>
117117 <Show when={error()}>
118- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
118+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
119119 </Show>
120120 <Button type="submit" class="h-9 w-full text-sm" disabled={pending()}>
121121 {t("auth.login")}
122122 </Button>
123123 </form>
124124 <p class="mt-8 border-t border-border-hairline pt-6 text-center text-sm text-text-subtle">
125- <Link to="/login" class="font-semibold text-primary underline-offset-4 hover:underline">
125+ <Link to="/login" class="font-semibold text-primary-text underline-offset-4 hover:underline">
126126 {t("builder.backToSchoolLogin")}
127127 </Link>
128128 </p>
src/pages/calendar-page.tsxmodified+1 -1
@@ -392,7 +392,7 @@ function CalendarContent() {
392392 </div>
393393
394394 <Show when={failedFeeds().length > 0}>
395- <div role="alert" class="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive">
395+ <div role="alert" class="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive-text">
396396 <span class="min-w-0 flex-1">{t("calendar.feedsFailed", { feeds: failedFeeds().join(", ") })}</span>
397397 <Button type="button" size="sm" variant="outline" class="shrink-0 border-destructive/40" onClick={() => board.retryFailed()}>
398398 {t("common.tryAgain")}
src/pages/class-detail-page.tsxmodified+1 -1
@@ -260,7 +260,7 @@ function ClassDetailContent() {
260260 {t("classBlueprints.apply")}
261261 </Button>
262262 <Button size="sm" variant="outline" class="rounded-lg" onClick={() => { setName(c().name); setGrade(c().grade ?? ""); setYearId(c().year ?? ""); setTeacherId(c().teacher?.id ?? ""); setEditing(true); }}>{t("common.edit")}</Button>
263- <Button size="sm" variant="outline" class="rounded-lg text-destructive" onClick={() => setDeleteOpen(true)}>{t("classGroups.deleteClass")}</Button>
263+ <Button size="sm" variant="outline" class="rounded-lg text-destructive-text" onClick={() => setDeleteOpen(true)}>{t("classGroups.deleteClass")}</Button>
264264 </div>
265265 </Show>
266266 </header>
src/pages/classes-page.tsxmodified+2 -2
@@ -184,7 +184,7 @@ function ClassesContent() {
184184 <SidePanel open={canManage() && showForm()} onOpenChange={setShowForm} guardUnsaved title={t("classGroups.newClass")} description={t("classGroups.subtitle")}>
185185 <form class="space-y-4" noValidate onSubmit={createClass}>
186186 <div class="space-y-3">
187- <div class="space-y-1.5"><Label for="class-name">{t("classGroups.className")}<span class="ml-0.5 text-destructive">*</span></Label><Input id="class-name" required aria-required="true" maxlength={limits.latest?.course.max_class_name_len} value={name()} error={nameError()} onInput={(e) => { setName(e.currentTarget.value); setNameError(""); }} /></div>
187+ <div class="space-y-1.5"><Label for="class-name">{t("classGroups.className")}<span class="ml-0.5 text-destructive-text">*</span></Label><Input id="class-name" required aria-required="true" maxlength={limits.latest?.course.max_class_name_len} value={name()} error={nameError()} onInput={(e) => { setName(e.currentTarget.value); setNameError(""); }} /></div>
188188 <div class="space-y-1.5"><Label for="class-grade">{t("classGroups.grade")}</Label><Input id="class-grade" maxlength={limits.latest?.course.max_class_grade_len} value={grade()} onInput={(e) => setGrade(e.currentTarget.value)} /></div>
189189 <div class="space-y-1.5"><Label for="class-year">{t("academicYears.year")}</Label><Select id="class-year" value={yearId()} onChange={(e) => setYearId(e.currentTarget.value)}><option value="">{t("academicYears.unassigned")}</option><For each={years.latest ?? []}>{(year) => <option value={year.id}>{year.name}</option>}</For></Select></div>
190190 <UserSearchSelect id="class-teacher" label={t("classGroups.homeroomTeacher")} value={teacherId()} onChange={setTeacherId} placeholder={t("classGroups.selectTeacher")} role="teacher" />
@@ -287,7 +287,7 @@ function ClassCard(props: { cls: ClassGroup; yearName: string; memberCount: numb
287287 class="flex flex-col gap-3 rounded-lg border border-border-line bg-surface-base p-4 text-left shadow-xs transition hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
288288 >
289289 <div class="flex items-center gap-2.5">
290- <span class="flex h-9 w-10 shrink-0 items-center justify-center rounded-md bg-info/10 text-[13px] font-semibold text-info">
290+ <span class="flex h-9 w-10 shrink-0 items-center justify-center rounded-md bg-info/10 text-[13px] font-semibold text-info-text">
291291 {props.cls.grade || "—"}
292292 </span>
293293 <div class="min-w-0 flex-1">
src/pages/course-detail-page.tsxmodified+2 -2
@@ -159,7 +159,7 @@ function CourseDetailContent() {
159159 header: t("classGroups.className"),
160160 meta: { cellClass: "font-medium" },
161161 cell: (cell) => (
162- <Link to="/instances/$id" params={{ id: cell.row.original.instance.id }} class="hover:text-primary hover:underline">
162+ <Link to="/instances/$id" params={{ id: cell.row.original.instance.id }} class="hover:text-primary-text hover:underline">
163163 {cell.row.original.className}
164164 </Link>
165165 ),
@@ -449,7 +449,7 @@ function CourseDetailContent() {
449449 <Alert variant="success">{flash()}</Alert>
450450 </Show>
451451 <Show when={error()}>
452- <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
452+ <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
453453 </Show>
454454
455455 <Tabs value={courseTab()} onChange={setCourseTab} class="space-y-4">
src/pages/courses-page.tsxmodified+1 -1
@@ -122,7 +122,7 @@ function CoursesContent() {
122122 <span class="font-medium text-text-default">{kindLabelSingular()}</span>
123123 </div>
124124 <div class="space-y-3">
125- <div class="space-y-1.5"><Label for="course-title">{t("form.title")}<span class="ml-0.5 text-destructive">*</span></Label><Input id="course-title" required maxlength={limits.latest?.course.max_title_len} value={title()} onInput={(e) => setTitle(e.currentTarget.value)} /></div>
125+ <div class="space-y-1.5"><Label for="course-title">{t("form.title")}<span class="ml-0.5 text-destructive-text">*</span></Label><Input id="course-title" required maxlength={limits.latest?.course.max_title_len} value={title()} onInput={(e) => setTitle(e.currentTarget.value)} /></div>
126126 <div class="space-y-1.5"><Label for="course-description">{t("form.description")}</Label><Textarea id="course-description" maxlength={limits.latest?.course.max_description_len} rows={3} value={description()} onInput={(e) => setDescription(e.currentTarget.value)} /></div>
127127 <p class="rounded-xl border border-border-line bg-surface-tint px-3 py-2 text-xs text-text-subtle">{t("instances.emptyHelp")}</p>
128128 </div>
src/pages/dashboard-page.tsxmodified+1 -1
@@ -724,7 +724,7 @@ function DashboardContent() {
724724
725725 <Suspense fallback={<PageSpinner />}>
726726 <Show when={error()}>
727- <div role="alert" class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive">
727+ <div role="alert" class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive-text">
728728 <span class="min-w-0 flex-1">{t("dashboard.partialError")} {error()}</span>
729729 <Button type="button" size="sm" variant="outline" class="shrink-0 border-destructive/40" onClick={() => board.retryFailed()}>
730730 {t("common.tryAgain")}
src/pages/event-detail-page.tsxmodified+1 -1
@@ -363,7 +363,7 @@ function EventDetailContent() {
363363 <Alert variant="success">{flash()}</Alert>
364364 </Show>
365365 {error() && (
366- <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
366+ <p class="rounded-sm bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
367367 )}
368368 </div>
369369 )}
src/pages/events-page.tsxmodified+1 -1
@@ -100,7 +100,7 @@ function EventsContent() {
100100 header: t("events.title"),
101101 cell: (cell) => (
102102 <div class="min-w-0">
103- <Link to="/events/$id" params={{ id: cell.row.original.id }} class="truncate font-medium hover:text-primary hover:underline">
103+ <Link to="/events/$id" params={{ id: cell.row.original.id }} class="truncate font-medium hover:text-primary-text hover:underline">
104104 {cell.row.original.title}
105105 </Link>
106106 <p class="truncate text-xs text-muted-foreground">{cell.row.original.description || "—"}</p>
src/pages/exam-detail-page.tsxmodified+3 -3
@@ -566,7 +566,7 @@ function ExamDetailContent() {
566566 </Button>
567567 </div>
568568 <Show when={answerError()}>
569- {(msg) => <p class="text-sm text-destructive">{msg()}</p>}
569+ {(msg) => <p class="text-sm text-destructive-text">{msg()}</p>}
570570 </Show>
571571 </form>
572572 </Show>
@@ -704,7 +704,7 @@ function ExamDetailContent() {
704704 <label
705705 class={cn(
706706 "inline-flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1 text-xs transition-colors hover:bg-muted/50",
707- reviewOn() && "text-primary",
707+ reviewOn() && "text-primary-text",
708708 )}
709709 title={t("exams.allowReviewHelp")}
710710 >
@@ -767,7 +767,7 @@ function ExamDetailContent() {
767767 <Alert variant="success">{flash()}</Alert>
768768 </Show>
769769 {error() && (
770- <p class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
770+ <p class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
771771 )}
772772
773773 <ConfirmDialog
src/pages/instance-detail-page.tsxmodified+2 -2
@@ -212,7 +212,7 @@ function InstanceDetailContent() {
212212 header: t("form.title"),
213213 meta: { cellClass: "font-medium" },
214214 cell: (cell) => (
215- <ExamLink examId={cell.row.original.id} class="hover:text-primary hover:underline">
215+ <ExamLink examId={cell.row.original.id} class="hover:text-primary-text hover:underline">
216216 {cell.row.original.title}
217217 </ExamLink>
218218 ),
@@ -501,7 +501,7 @@ function InstanceDetailContent() {
501501 <Alert variant="success">{flash()}</Alert>
502502 </Show>
503503 <Show when={error()}>
504- <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
504+ <p class="rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
505505 </Show>
506506
507507 <Tabs value={tab()} onChange={setTab} class="space-y-4">
src/pages/live-monitor-page.tsxmodified+4 -4
@@ -291,16 +291,16 @@ function LiveMonitorContent() {
291291 <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconClock class="h-3.5 w-3.5" />{t("exams.notStarted")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().not_started}</p>
292292 </div>
293293 <div class="data-shell bg-card/80 p-3">
294- <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconExam class="h-3.5 w-3.5 text-info" />{t("attempt.inProgress")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().in_progress}</p>
294+ <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconExam class="h-3.5 w-3.5 text-info-text" />{t("attempt.inProgress")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().in_progress}</p>
295295 </div>
296296 <div class="data-shell bg-card/80 p-3">
297- <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconCheck class="h-3.5 w-3.5 text-success" />{t("attempt.submitted")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().submitted}</p>
297+ <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconCheck class="h-3.5 w-3.5 text-success-text" />{t("attempt.submitted")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().submitted}</p>
298298 </div>
299299 <div class="data-shell bg-card/80 p-3">
300- <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconClock class="h-3.5 w-3.5 text-destructive" />{t("attempt.expired")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().expired}</p>
300+ <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconClock class="h-3.5 w-3.5 text-destructive-text" />{t("attempt.expired")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().expired}</p>
301301 </div>
302302 <div class="data-shell bg-card/80 p-3">
303- <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconAlert class="h-3.5 w-3.5 text-destructive" />{t("attempt.noAttemptsLeft")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().no_attempts_left}</p>
303+ <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconAlert class="h-3.5 w-3.5 text-destructive-text" />{t("attempt.noAttemptsLeft")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().no_attempts_left}</p>
304304 </div>
305305 <div class="data-shell bg-card/80 p-3">
306306 <p class="flex items-center gap-1.5 text-xs text-muted-foreground"><IconUsers class="h-3.5 w-3.5" />{t("attempt.absent")}</p><p class="mt-1 text-2xl font-semibold tabular-nums">{counts().absent}</p>
src/pages/login-page.tsxmodified+4 -4
@@ -155,7 +155,7 @@ function LoginForm() {
155155 </div>
156156
157157 {error() && (
158- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
158+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
159159 )}
160160
161161 <Button type="submit" class="h-9 w-full text-sm" disabled={pending()}>
@@ -165,7 +165,7 @@ function LoginForm() {
165165
166166 <p class="mt-8 border-t border-border-hairline pt-6 text-center text-sm text-text-subtle">
167167 {t("auth.noAccount")}{" "}
168- <Link to="/register" class="font-semibold text-primary underline-offset-4 hover:underline">
168+ <Link to="/register" class="font-semibold text-primary-text underline-offset-4 hover:underline">
169169 {t("auth.register")}
170170 </Link>
171171 </p>
@@ -189,7 +189,7 @@ function LoginForm() {
189189 disabled={pending()}
190190 onClick={() => void handleSchoolSelect(school.slug)}
191191 >
192- <IconSchool class="h-5 w-5 shrink-0 text-primary" />
192+ <IconSchool class="h-5 w-5 shrink-0 text-primary-text" />
193193 <span class="min-w-0 flex-1">
194194 <span class="block truncate font-semibold text-text-strong">{school.name}</span>
195195 <span class="block truncate text-xs font-normal text-text-subtle">{school.slug}</span>
@@ -202,7 +202,7 @@ function LoginForm() {
202202 </For>
203203
204204 {error() && (
205- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
205+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
206206 )}
207207
208208 <Button
src/pages/meal-detail-page.tsxmodified+5 -5
@@ -205,7 +205,7 @@ function MealDetailContent() {
205205 </div>
206206
207207 <Show when={conflicts().length > 0}>
208- <Alert class="border-warning/50 bg-warning/10 text-warning"><span class="flex gap-2"><IconAlert class="mt-0.5 h-4 w-4 shrink-0" /><span>{t("meals.conflict")}: {conflicts().join(", ")}</span></span></Alert>
208+ <Alert class="border-warning/50 bg-warning/10 text-warning-text"><span class="flex gap-2"><IconAlert class="mt-0.5 h-4 w-4 shrink-0" /><span>{t("meals.conflict")}: {conflicts().join(", ")}</span></span></Alert>
209209 </Show>
210210
211211 <Show when={isParent()}>
@@ -226,8 +226,8 @@ function MealDetailContent() {
226226 <article class="rounded-xl border border-border-line bg-surface-base p-4">
227227 <div class="flex justify-between gap-3"><h2 class="font-semibold text-text-strong">{dish.name}</h2><span class="font-semibold">{formatTry(dish.price_minor, moneyLocale())}</span></div>
228228 <p class="mt-2 text-sm text-text-subtle">{dish.description || "—"}</p>
229- <div class="mt-3 flex flex-wrap gap-1"><For each={dish.tags}>{(tag) => <Badge variant="outline" class={dish.conflicts.includes(tag) ? "border-warning/50 bg-warning/10 text-warning" : ""}>{dish.conflicts.includes(tag) ? `⚠ ${tag}` : tag}</Badge>}</For></div>
230- <Show when={canManage()}><div class="mt-3 flex gap-2 border-t border-border-hairline pt-3"><Button variant="outline" size="sm" onClick={() => openDish(dish)}>{t("common.edit")}</Button><Button variant="ghost" size="sm" class="text-destructive" onClick={() => setDeleteDish(dish)}>{t("common.delete")}</Button></div></Show>
229+ <div class="mt-3 flex flex-wrap gap-1"><For each={dish.tags}>{(tag) => <Badge variant="outline" class={dish.conflicts.includes(tag) ? "border-warning/50 bg-warning/10 text-warning-text" : ""}>{dish.conflicts.includes(tag) ? `⚠ ${tag}` : tag}</Badge>}</For></div>
230+ <Show when={canManage()}><div class="mt-3 flex gap-2 border-t border-border-hairline pt-3"><Button variant="outline" size="sm" onClick={() => openDish(dish)}>{t("common.edit")}</Button><Button variant="ghost" size="sm" class="text-destructive-text" onClick={() => setDeleteDish(dish)}>{t("common.delete")}</Button></div></Show>
231231 </article>
232232 )}</For>
233233 </div>
@@ -242,7 +242,7 @@ function MealDetailContent() {
242242
243243 <TabsContent value="account" class="space-y-4">
244244 <div class="grid gap-4 lg:grid-cols-2">
245- <section class="data-shell p-4"><h2 class="font-semibold text-text-strong">{t("meals.dietaryProfile")}</h2><div class="mt-3 flex flex-wrap gap-1.5"><For each={profile()?.tags ?? []}>{(tag) => <Badge variant="outline" class="border-warning/50 bg-warning/10 text-warning">⚠ {tag}</Badge>}</For></div><p class="mt-3 text-sm text-text-subtle">{profile()?.note || t("meals.noDietaryNotes")}</p></section>
245+ <section class="data-shell p-4"><h2 class="font-semibold text-text-strong">{t("meals.dietaryProfile")}</h2><div class="mt-3 flex flex-wrap gap-1.5"><For each={profile()?.tags ?? []}>{(tag) => <Badge variant="outline" class="border-warning/50 bg-warning/10 text-warning-text">⚠ {tag}</Badge>}</For></div><p class="mt-3 text-sm text-text-subtle">{profile()?.note || t("meals.noDietaryNotes")}</p></section>
246246 <Show when={canReadMoney()}><section class="data-shell p-4"><h2 class="font-semibold text-text-strong">{t("meals.balance")}</h2><p class="mt-3 text-2xl font-semibold tabular-nums">{formatTry(balance()?.balance_minor ?? 0, moneyLocale())}</p></section></Show>
247247 </div>
248248 <Show when={canReadMoney()}><section class="data-shell p-4"><h2 class="font-semibold text-text-strong">{t("meals.ledger")}</h2><div class="mt-3 divide-y divide-border-hairline"><For each={ledger()?.items ?? []}>{(line) => <div class="flex justify-between gap-3 py-3 text-sm"><div><p class="font-medium">{t(`meals.ledger.${line.kind}` as never)}</p><p class="text-xs text-text-subtle">{line.note || line.method || "—"} · {formatDateTime(line.created_at, locale())}</p></div><span class="font-semibold tabular-nums">{line.kind === "charge" ? "−" : "+"}{formatTry(line.amount_minor, moneyLocale())}</span></div>}</For></div><Show when={(ledger()?.items.length ?? 0) === 0}><p class="mt-3 text-sm text-text-subtle">{t("meals.noLedger")}</p></Show></section></Show>
@@ -256,7 +256,7 @@ function MealDetailContent() {
256256 </div>
257257 <Show when={serviceAttendance.error || serviceBookings.error}><ErrorAlert message={formatApiError(serviceAttendance.error || serviceBookings.error)} onRetry={() => void refetchService()} /></Show>
258258 <div class="space-y-2">
259- <For each={serviceEntries()}>{(entry) => <div class="data-shell flex flex-wrap items-center justify-between gap-3 p-3"><div><p class="font-medium">{personLabel(entry.student)}</p><p class="text-xs text-text-subtle">{entry.booking ? t("meals.booked") : t("meals.walkIn")} · {entry.attendance?.status ?? t("meals.notMarked")}</p></div><div class="flex gap-2"><Button size="sm" variant={entry.attendance?.status === "served" ? "default" : "outline"} onClick={() => void run(async () => { await postMealAttendance(id(), entry.student.id, "served"); await refetchService(); })}>{t("meals.served")}</Button><Button size="sm" variant={entry.attendance?.status === "missed" ? "destructive" : "outline"} onClick={() => void run(async () => { await postMealAttendance(id(), entry.student.id, "missed"); await refetchService(); })}>{t("meals.missed")}</Button><Show when={canManage() && entry.booking?.status === "booked"}><Button size="sm" variant="ghost" class="text-destructive" onClick={() => setCancelBooking(entry.booking)}>{t("meals.cancelBooking")}</Button></Show></div></div>}</For>
259+ <For each={serviceEntries()}>{(entry) => <div class="data-shell flex flex-wrap items-center justify-between gap-3 p-3"><div><p class="font-medium">{personLabel(entry.student)}</p><p class="text-xs text-text-subtle">{entry.booking ? t("meals.booked") : t("meals.walkIn")} · {entry.attendance?.status ?? t("meals.notMarked")}</p></div><div class="flex gap-2"><Button size="sm" variant={entry.attendance?.status === "served" ? "default" : "outline"} onClick={() => void run(async () => { await postMealAttendance(id(), entry.student.id, "served"); await refetchService(); })}>{t("meals.served")}</Button><Button size="sm" variant={entry.attendance?.status === "missed" ? "destructive" : "outline"} onClick={() => void run(async () => { await postMealAttendance(id(), entry.student.id, "missed"); await refetchService(); })}>{t("meals.missed")}</Button><Show when={canManage() && entry.booking?.status === "booked"}><Button size="sm" variant="ghost" class="text-destructive-text" onClick={() => setCancelBooking(entry.booking)}>{t("meals.cancelBooking")}</Button></Show></div></div>}</For>
260260 </div>
261261 </TabsContent>
262262
src/pages/messages-page.tsxmodified+6 -6
@@ -223,7 +223,7 @@ export default function MessagesPage() {
223223 class={cn(
224224 "flex h-8 shrink-0 items-center justify-between gap-2 rounded-lg px-3 text-xs font-semibold transition-colors",
225225 folder() === "inbox"
226- ? "bg-primary/10 text-primary"
226+ ? "bg-primary/10 text-primary-text"
227227 : "text-muted-foreground hover:bg-muted/40 hover:text-foreground"
228228 )}
229229 onClick={() =>
@@ -250,7 +250,7 @@ export default function MessagesPage() {
250250 class={cn(
251251 "flex h-8 shrink-0 items-center justify-between gap-2 rounded-lg px-3 text-xs font-semibold transition-colors",
252252 folder() === "sent"
253- ? "bg-primary/10 text-primary"
253+ ? "bg-primary/10 text-primary-text"
254254 : "text-muted-foreground hover:bg-muted/40 hover:text-foreground"
255255 )}
256256 onClick={() =>
@@ -272,7 +272,7 @@ export default function MessagesPage() {
272272 class={cn(
273273 "flex h-8 shrink-0 items-center justify-between gap-2 rounded-lg px-3 text-xs font-semibold transition-colors",
274274 folder() === "archive"
275- ? "bg-primary/10 text-primary"
275+ ? "bg-primary/10 text-primary-text"
276276 : "text-muted-foreground hover:bg-muted/40 hover:text-foreground"
277277 )}
278278 onClick={() =>
@@ -294,7 +294,7 @@ export default function MessagesPage() {
294294 class={cn(
295295 "flex h-8 shrink-0 items-center justify-between gap-2 rounded-lg px-3 text-xs font-semibold transition-colors",
296296 folder() === "trash"
297- ? "bg-destructive/10 text-destructive"
297+ ? "bg-destructive/10 text-destructive-text"
298298 : "text-muted-foreground hover:bg-muted/40 hover:text-foreground"
299299 )}
300300 onClick={() =>
@@ -331,7 +331,7 @@ export default function MessagesPage() {
331331 <IconRefresh
332332 class={cn(
333333 "h-3.5 w-3.5 mr-1.5 transition-transform duration-500",
334- isRefreshing() && "animate-spin text-primary"
334+ isRefreshing() && "animate-spin text-primary-text"
335335 )}
336336 />
337337 {t("common.refresh")}
@@ -353,7 +353,7 @@ export default function MessagesPage() {
353353 <Button
354354 variant="outline"
355355 size="sm"
356- class="h-8 rounded-lg text-[13px] text-destructive hover:bg-destructive/10"
356+ class="h-8 rounded-lg text-[13px] text-destructive-text hover:bg-destructive/10"
357357 onClick={() => setConfirmEmptyTrash(true)}
358358 >
359359 <IconTrash class="mr-1.5 h-3.5 w-3.5" />
src/pages/my-students-page.tsxmodified+1 -1
@@ -85,7 +85,7 @@ function MyStudentsContent() {
8585 <div class="truncate font-medium text-text-strong">{personLabel(student)}</div>
8686 <div class="truncate text-sm text-text-subtle">@{student.username}</div>
8787 </div>
88- <IconChevronRight class="h-5 w-5 shrink-0 text-text-subtle/70 transition-colors group-hover:text-primary" />
88+ <IconChevronRight class="h-5 w-5 shrink-0 text-text-subtle/70 transition-colors group-hover:text-primary-text" />
8989 </button>
9090 )}
9191 </For>
src/pages/payment-statement-page.tsxmodified+2 -2
@@ -80,7 +80,7 @@ function StatementContent() {
8080 {
8181 accessorKey: "due_at",
8282 header: t("payments.due"),
83- cell: (cell) => <span class="mono block whitespace-nowrap text-sm" classList={{ "font-semibold text-destructive": cell.row.original.overdue }}>{cell.row.original.due_at == null ? "—" : formatDate(cell.row.original.due_at, locale())}</span>,
83+ cell: (cell) => <span class="mono block whitespace-nowrap text-sm" classList={{ "font-semibold text-destructive-text": cell.row.original.overdue }}>{cell.row.original.due_at == null ? "—" : formatDate(cell.row.original.due_at, locale())}</span>,
8484 },
8585 {
8686 accessorKey: "outstanding_minor",
@@ -145,7 +145,7 @@ function StatementContent() {
145145 </div>
146146 <div>
147147 <p class="text-xs font-medium text-text-subtle">{t("payments.balance")}</p>
148- <p class="mt-1 text-2xl font-semibold tabular-nums" classList={{ "text-destructive": summary().balance < 0 }}>{formatTry(summary().balance, moneyLocale())}</p>
148+ <p class="mt-1 text-2xl font-semibold tabular-nums" classList={{ "text-destructive-text": summary().balance < 0 }}>{formatTry(summary().balance, moneyLocale())}</p>
149149 </div>
150150 </div>
151151 </section>
src/pages/payments-page.tsxmodified+7 -7
@@ -208,7 +208,7 @@ function PaymentsContent() {
208208 if (bal == null) return <span class="text-sm text-muted-foreground">—</span>;
209209 const inDebt = bal < 0;
210210 return (
211- <Badge variant="outline" class={inDebt ? "border-destructive/50 bg-destructive/10 text-destructive" : "border-success/50 bg-success/10 text-success"}>
211+ <Badge variant="outline" class={inDebt ? "border-destructive/50 bg-destructive/10 text-destructive-text" : "border-success/50 bg-success/10 text-success-text"}>
212212 <span class={`mr-1.5 inline-block h-1.5 w-1.5 rounded-full ${inDebt ? "bg-destructive" : "bg-success"}`} />
213213 {inDebt ? t("payments.inDebt") : t("payments.settled")}
214214 </Badge>
@@ -221,7 +221,7 @@ function PaymentsContent() {
221221 accessorFn: (user) => user.balance_minor ?? 0,
222222 cell: (cell) => {
223223 const bal = cell.row.original.balance_minor;
224- return <span class="font-medium tabular-nums" classList={{ "text-destructive": (bal ?? 0) < 0 }}>{bal == null ? "—" : formatTry(bal, moneyLocale())}</span>;
224+ return <span class="font-medium tabular-nums" classList={{ "text-destructive-text": (bal ?? 0) < 0 }}>{bal == null ? "—" : formatTry(bal, moneyLocale())}</span>;
225225 },
226226 },
227227 {
@@ -352,7 +352,7 @@ function PaymentsContent() {
352352 accessorKey: "due_at",
353353 header: t("payments.due"),
354354 size: 120,
355- cell: (cell) => <span class="mono whitespace-nowrap text-sm" classList={{ "font-semibold text-destructive": cell.row.original.overdue }}>{cell.row.original.due_at == null ? "—" : formatDate(cell.row.original.due_at, locale())}</span>,
355+ cell: (cell) => <span class="mono whitespace-nowrap text-sm" classList={{ "font-semibold text-destructive-text": cell.row.original.overdue }}>{cell.row.original.due_at == null ? "—" : formatDate(cell.row.original.due_at, locale())}</span>,
356356 },
357357 {
358358 accessorKey: "outstanding_minor",
@@ -665,8 +665,8 @@ function PaymentsContent() {
665665 <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
666666 <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.totalDebt")}</p><p class="mt-1 font-semibold tabular-nums">{formatTry(summary().billed, moneyLocale())}</p></div>
667667 <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.collected")}</p><p class="mt-1 font-semibold tabular-nums">{formatTry(summary().collected, moneyLocale())}</p></div>
668- <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.balance")}</p><p class="mt-1 font-semibold tabular-nums" classList={{ "text-destructive": summary().balance < 0 }}>{formatTry(summary().balance, moneyLocale())}</p></div>
669- <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.overdueCount")}</p><p class="mt-1 font-semibold tabular-nums" classList={{ "text-destructive": summary().overdue > 0 }}>{summary().overdue}</p></div>
668+ <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.balance")}</p><p class="mt-1 font-semibold tabular-nums" classList={{ "text-destructive-text": summary().balance < 0 }}>{formatTry(summary().balance, moneyLocale())}</p></div>
669+ <div class="detail-metric-card"><p class="text-xs font-medium text-text-subtle">{t("payments.overdueCount")}</p><p class="mt-1 font-semibold tabular-nums" classList={{ "text-destructive-text": summary().overdue > 0 }}>{summary().overdue}</p></div>
670670 </div>
671671
672672 <section class="data-shell space-y-4 p-4">
@@ -731,7 +731,7 @@ function PaymentsContent() {
731731 <Button size="sm" variant="outline" onClick={() => openLineAction(line, "refund")}>{t("payments.recordRefund")}</Button>
732732 </Show>
733733 <Show when={line.kind === "charge" || line.kind === "refund"}>
734- <Button size="sm" variant="ghost" class="text-destructive" onClick={() => openLineAction(line, "reverse")}>{t("payments.reverse")}</Button>
734+ <Button size="sm" variant="ghost" class="text-destructive-text" onClick={() => openLineAction(line, "reverse")}>{t("payments.reverse")}</Button>
735735 </Show>
736736 </div>
737737 </div>
@@ -946,7 +946,7 @@ function PaymentsContent() {
946946 <DatePicker id={`inst-due-${idx}`} placeholder={t("form.datePlaceholder")} required value={row().due} onChange={(value) => setRowDue(idx, value)} />
947947 </div>
948948 <Show when={rows().length > 1}>
949- <Button type="button" variant="ghost" size="sm" class="text-destructive" onClick={() => removeRow(idx)} aria-label={t("common.delete")}>
949+ <Button type="button" variant="ghost" size="sm" class="text-destructive-text" onClick={() => removeRow(idx)} aria-label={t("common.delete")}>
950950 <IconTrash class="h-4 w-4" />
951951 </Button>
952952 </Show>
src/pages/pomodoro-page.tsxmodified+3 -3
@@ -228,15 +228,15 @@ function PomodoroContent() {
228228 />
229229 </svg>
230230 <span class="absolute text-center">
231- <IconClock class={cn("h-7 w-7 mx-auto text-primary", running() && "animate-pulse")} />
231+ <IconClock class={cn("h-7 w-7 mx-auto text-primary-text", running() && "animate-pulse")} />
232232 </span>
233233 </div>
234234
235235 <div>
236- <p class={cn("text-xs font-medium uppercase tracking-[0.08em]", running() && isOvertime() ? "text-destructive" : "text-muted-foreground")}>
236+ <p class={cn("text-xs font-medium uppercase tracking-[0.08em]", running() && isOvertime() ? "text-destructive-text" : "text-muted-foreground")}>
237237 {running() ? (isOvertime() ? t("pomodoro.overtime") : t("pomodoro.remaining")) : t("pomodoro.total")}
238238 </p>
239- <p class={cn("mono mt-2 text-5xl font-semibold leading-none tracking-tight tabular-nums sm:text-6xl", running() && isOvertime() && "text-destructive")}>
239+ <p class={cn("mono mt-2 text-5xl font-semibold leading-none tracking-tight tabular-nums sm:text-6xl", running() && isOvertime() && "text-destructive-text")}>
240240 {running() && isOvertime() && "+"}
241241 {formatDurationClock(running() ? (isOvertime() ? overtimeMs() : remainingMs()) : log()?.total_focus_ms)}
242242 </p>
src/pages/profile-page.tsxmodified+1 -1
@@ -249,7 +249,7 @@ function ProfileContent() {
249249 function StatCard(props: { icon: PixelIconName; label: string; value: number }) {
250250 return (
251251 <div class="group flex items-center gap-3 rounded-lg border bg-card p-3 shadow-xs transition-colors hover:border-primary/30">
252- <span class="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary transition-transform duration-200 group-hover:-rotate-6">
252+ <span class="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary-text transition-transform duration-200 group-hover:-rotate-6">
253253 <PixelIcon name={props.icon} class="h-5 w-5" />
254254 </span>
255255 <div class="min-w-0">
src/pages/question-bank-page.tsxmodified+1 -1
@@ -150,7 +150,7 @@ function QuestionBankContent() {
150150 </Badge>
151151 }
152152 >
153- <Badge variant="outline" class="gap-1 whitespace-nowrap border-success/50 bg-success/10 text-success">
153+ <Badge variant="outline" class="gap-1 whitespace-nowrap border-success/50 bg-success/10 text-success-text">
154154 <IconUsers class="h-3 w-3" />
155155 {t("bank.sharedWithSchool")}
156156 </Badge>
src/pages/question-detail-page.tsxmodified+7 -7
@@ -146,7 +146,7 @@ function QuestionDetailContent() {
146146 </div>
147147 </div>
148148
149- {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>}
149+ {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>}
150150
151151 <div class="rounded-xl border bg-card p-6 shadow-xs">
152152 <p class="whitespace-pre-wrap text-foreground">{q().body}</p>
@@ -188,7 +188,7 @@ function QuestionDetailContent() {
188188 <Button
189189 variant="ghost"
190190 size="sm"
191- class="text-destructive hover:bg-destructive/10"
191+ class="text-destructive-text hover:bg-destructive/10"
192192 disabled={imageBusy()}
193193 onClick={() => void swapQuestionImage(null)}
194194 >
@@ -218,7 +218,7 @@ function QuestionDetailContent() {
218218 <div class="rounded-xl border bg-card/50 p-5">
219219 <div class="flex items-center justify-between">
220220 <div class="flex items-center gap-2 text-sm font-medium">
221- <div class="flex h-6 w-6 items-center justify-center rounded-full bg-primary/10 text-[10px] text-primary">
221+ <div class="flex h-6 w-6 items-center justify-center rounded-full bg-primary/10 text-[10px] text-primary-text">
222222 {sol.author.display_name?.[0] || sol.author.username[0].toUpperCase()}
223223 </div>
224224 {personLabel(sol.author)}
@@ -231,7 +231,7 @@ function QuestionDetailContent() {
231231 <IconEdit class="h-4 w-4" />
232232 </Button>
233233 </Show>
234- <Button variant="ghost" size="icon" class="h-8 w-8 text-destructive hover:bg-destructive/10" onClick={() => setDeleteConfirmS(sol)} aria-label={t("common.delete")}>
234+ <Button variant="ghost" size="icon" class="h-8 w-8 text-destructive-text hover:bg-destructive/10" onClick={() => setDeleteConfirmS(sol)} aria-label={t("common.delete")}>
235235 <IconTrash class="h-4 w-4" />
236236 </Button>
237237 </div>
@@ -390,7 +390,7 @@ function SolutionFormDialog(props: { questionId: string; initialData?: SolutionR
390390 type="button"
391391 variant="ghost"
392392 size="sm"
393- class="ml-auto text-destructive hover:bg-destructive/10"
393+ class="ml-auto text-destructive-text hover:bg-destructive/10"
394394 onClick={() => setRemoveImage(true)}
395395 >
396396 <IconX class="mr-1 h-4 w-4" />
@@ -404,7 +404,7 @@ function SolutionFormDialog(props: { questionId: string; initialData?: SolutionR
404404 fallback={
405405 <div class="flex flex-col items-center gap-2">
406406 <div class="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10">
407- <IconPhoto class="h-6 w-6 text-primary" />
407+ <IconPhoto class="h-6 w-6 text-primary-text" />
408408 </div>
409409 <div class="flex items-center gap-2">
410410 <span class="text-sm font-medium text-foreground">{file()?.name}</span>
@@ -412,7 +412,7 @@ function SolutionFormDialog(props: { questionId: string; initialData?: SolutionR
412412 type="button"
413413 variant="ghost"
414414 size="icon"
415- class="h-6 w-6 rounded-full hover:bg-destructive/10 hover:text-destructive z-10"
415+ class="h-6 w-6 rounded-full hover:bg-destructive/10 hover:text-destructive-text z-10"
416416 onClick={(e) => {
417417 e.stopPropagation();
418418 e.preventDefault();
src/pages/questions-page.tsxmodified+5 -5
@@ -117,7 +117,7 @@ function QuestionsContent() {
117117 <div class="group flex flex-col gap-2 p-4 transition-colors hover:bg-muted/40 sm:flex-row sm:items-center sm:justify-between">
118118 <Link to="/questions/$id" params={{ id: question.id }} class="min-w-0 flex-1">
119119 <div class="flex items-center gap-2">
120- <h3 class="truncate text-base font-semibold text-foreground group-hover:text-primary transition-colors">{question.title}</h3>
120+ <h3 class="truncate text-base font-semibold text-foreground group-hover:text-primary-text transition-colors">{question.title}</h3>
121121 <Show when={question.image}>
122122 <IconPhoto class="h-4 w-4 text-muted-foreground" />
123123 </Show>
@@ -125,7 +125,7 @@ function QuestionsContent() {
125125 <p class="mt-1 line-clamp-2 text-sm text-muted-foreground">{question.body}</p>
126126 <div class="mt-2 flex items-center gap-3 text-xs text-muted-foreground">
127127 <span class="flex items-center gap-1">
128- <div class="flex h-4 w-4 items-center justify-center rounded-full bg-primary/10 text-[8px] font-bold text-primary">
128+ <div class="flex h-4 w-4 items-center justify-center rounded-full bg-primary/10 text-[8px] font-bold text-primary-text">
129129 {question.asker.display_name?.[0] || question.asker.username[0].toUpperCase()}
130130 </div>
131131 {personLabel(question.asker)}
@@ -148,7 +148,7 @@ function QuestionsContent() {
148148 type="button"
149149 variant="ghost"
150150 size="sm"
151- class="h-8 w-8 p-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive rounded-lg"
151+ class="h-8 w-8 p-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text rounded-lg"
152152 title={t("common.delete")}
153153 onClick={(e) => {
154154 e.preventDefault();
@@ -254,7 +254,7 @@ function AskQuestionDialog(props: { onClose: () => void; onSuccess: () => void }
254254 fallback={
255255 <div class="flex flex-col items-center gap-2">
256256 <div class="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10">
257- <IconPhoto class="h-6 w-6 text-primary" />
257+ <IconPhoto class="h-6 w-6 text-primary-text" />
258258 </div>
259259 <div class="flex items-center gap-2">
260260 <span class="text-sm font-medium text-foreground">{file()?.name}</span>
@@ -262,7 +262,7 @@ function AskQuestionDialog(props: { onClose: () => void; onSuccess: () => void }
262262 type="button"
263263 variant="ghost"
264264 size="icon"
265- class="h-6 w-6 rounded-full hover:bg-destructive/10 hover:text-destructive z-10"
265+ class="h-6 w-6 rounded-full hover:bg-destructive/10 hover:text-destructive-text z-10"
266266 onClick={(e) => {
267267 e.stopPropagation();
268268 e.preventDefault();
src/pages/register-page.tsxmodified+2 -2
@@ -142,7 +142,7 @@ function RegisterForm() {
142142 </div>
143143
144144 {error() && (
145- <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>
145+ <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive-text">{error()}</p>
146146 )}
147147
148148 <Button type="submit" class="h-9 w-full text-sm" disabled={pending()}>
@@ -152,7 +152,7 @@ function RegisterForm() {
152152
153153 <p class="mt-8 border-t border-border-hairline pt-6 text-center text-sm text-text-subtle">
154154 {t("auth.hasAccount")}{" "}
155- <Link to="/login" class="font-semibold text-primary underline-offset-4 hover:underline">
155+ <Link to="/login" class="font-semibold text-primary-text underline-offset-4 hover:underline">
156156 {t("auth.login")}
157157 </Link>
158158 </p>
src/pages/settings-page.tsxmodified+6 -6
@@ -187,7 +187,7 @@ function SettingsContent() {
187187 <span class="text-xs text-muted-foreground">{t("settings.unsaved")}</span>
188188 </Show>
189189 <Show when={saved() && !dirty()}>
190- <span class="text-xs text-success">{t("settings.saved")}</span>
190+ <span class="text-xs text-success-text">{t("settings.saved")}</span>
191191 </Show>
192192 <Button
193193 type="button"
@@ -291,7 +291,7 @@ function SettingsContent() {
291291 type="button"
292292 variant="ghost"
293293 size="icon"
294- class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive"
294+ class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text"
295295 aria-label={t("common.delete")}
296296 onClick={() => setExamKinds((rows) => rows.filter((_, i) => i !== index))}
297297 >
@@ -378,7 +378,7 @@ function SettingsContent() {
378378 type="button"
379379 variant="ghost"
380380 size="icon"
381- class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive disabled:opacity-30"
381+ class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text disabled:opacity-30"
382382 aria-label={t("common.delete")}
383383 disabled={CORE_ATTENDANCE.has(status())}
384384 onClick={() => setAttendanceStatuses((rows) => rows.filter((_, i) => i !== index))}
@@ -461,7 +461,7 @@ function SettingsContent() {
461461 type="button"
462462 variant="ghost"
463463 size="icon"
464- class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive"
464+ class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text"
465465 aria-label={t("common.delete")}
466466 onClick={() => setGradeBands((rows) => rows.filter((_, i) => i !== index))}
467467 >
@@ -538,7 +538,7 @@ function SettingsContent() {
538538 value={minuteToUtcTime(slot().serving_minute)}
539539 onInput={(e) => setMealSlots((rows) => rows.map((row, i) => i === index ? { ...row, serving_minute: utcTimeToMinute(e.currentTarget.value) } : row))}
540540 />
541- <Button type="button" variant="ghost" size="icon" class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive" aria-label={t("common.delete")} onClick={() => setMealSlots((rows) => rows.filter((_, i) => i !== index))}><IconTrash class="h-4 w-4" /></Button>
541+ <Button type="button" variant="ghost" size="icon" class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text" aria-label={t("common.delete")} onClick={() => setMealSlots((rows) => rows.filter((_, i) => i !== index))}><IconTrash class="h-4 w-4" /></Button>
542542 </div>
543543 )}
544544 </Index>
@@ -569,7 +569,7 @@ function SettingsContent() {
569569 placeholder={t("settings.dietaryTags")}
570570 onInput={(e) => setDietaryTags((rows) => rows.map((row, i) => i === index ? e.currentTarget.value : row))}
571571 />
572- <Button type="button" variant="ghost" size="icon" class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive" aria-label={t("common.delete")} onClick={() => setDietaryTags((rows) => rows.filter((_, i) => i !== index))}><IconTrash class="h-4 w-4" /></Button>
572+ <Button type="button" variant="ghost" size="icon" class="h-9 w-9 rounded-md text-muted-foreground hover:text-destructive-text" aria-label={t("common.delete")} onClick={() => setDietaryTags((rows) => rows.filter((_, i) => i !== index))}><IconTrash class="h-4 w-4" /></Button>
573573 </div>
574574 )}
575575 </Index>
src/pages/student-marks-page.tsxmodified+1 -1
@@ -21,7 +21,7 @@ import { useT } from "@/stores/preferences-context";
2121 const PAGE_SIZE = 10;
2222 const round = (n: number) => (Math.round(n * 100) / 100).toString();
2323 // ponytail: display-only color tiers (70/40 on a 0-100 scale), not a pass/fail rule
24-const avgTone = (v: number) => (v >= 70 ? "text-success" : v >= 40 ? "text-warning" : "text-destructive");
24+const avgTone = (v: number) => (v >= 70 ? "text-success-text" : v >= 40 ? "text-warning-text" : "text-destructive-text");
2525
2626 export default function StudentMarksPage() {
2727 return (
src/pages/whiteboard-page.tsxmodified+5 -5
@@ -234,7 +234,7 @@ function WhiteboardContent() {
234234 <Show when={isCreator()}>
235235 <DropdownMenu placement="bottom-end" gutter={8}>
236236 <DropdownMenuTrigger
237- class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border-line bg-surface-tint text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary"
237+ class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border-line bg-surface-tint text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary-text focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary-text"
238238 aria-label={t("common.actions")}
239239 title={t("common.actions")}
240240 >
@@ -251,7 +251,7 @@ function WhiteboardContent() {
251251 {t("whiteboard.clear")}
252252 </DropdownMenuItem>
253253 <DropdownMenuSeparator />
254- <DropdownMenuItem class="text-warning focus:bg-warning/10 focus:text-warning data-highlighted:bg-warning/10 data-highlighted:text-warning" disabled={busy()} onSelect={() => setTimeout(() => setCloseOpen(true), 0)}>
254+ <DropdownMenuItem class="text-warning-text focus:bg-warning/10 focus:text-warning-text data-highlighted:bg-warning/10 data-highlighted:text-warning-text" disabled={busy()} onSelect={() => setTimeout(() => setCloseOpen(true), 0)}>
255255 <IconLock class="h-4 w-4" />
256256 {t("whiteboard.close")}
257257 </DropdownMenuItem>
@@ -300,7 +300,7 @@ function WhiteboardContent() {
300300 <For each={roster()}>
301301 {(userId) => (
302302 <li class="group flex items-center gap-2 rounded-xl px-2 py-2 transition-colors hover:bg-muted/60">
303- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary">
303+ <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary-text">
304304 {nameOf(userId).slice(0, 1).toLocaleUpperCase(locale())}
305305 </span>
306306 <span class="min-w-0 flex-1">
@@ -317,7 +317,7 @@ function WhiteboardContent() {
317317 type="button"
318318 variant="ghost"
319319 size="icon"
320- class="h-8 w-8 shrink-0 rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive"
320+ class="h-8 w-8 shrink-0 rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive-text"
321321 disabled={busy()}
322322 title={t("whiteboard.removeParticipant")}
323323 aria-label={t("whiteboard.removeParticipant")}
@@ -372,7 +372,7 @@ function WhiteboardContent() {
372372 summary={b().title}
373373 confirmLabel={t("whiteboard.close")}
374374 icon={<IconLock class="h-4 w-4" />}
375- iconClass="border-warning/40 bg-warning/10 text-warning"
375+ iconClass="border-warning/40 bg-warning/10 text-warning-text"
376376 onConfirm={doClose}
377377 />
378378 <ConfirmDialog
src/stores/accent-text.test.tsxadded+25 -0
@@ -0,0 +1,25 @@
1+import { expect, test } from "vitest";
2+import { accentTextLightness } from "@/stores/preferences-context";
3+
4+// Same formula as WCAG, kept local so the test does not share the code under test.
5+const luminance = (h: number, s: number, l: number) => {
6+ const a = (s / 100) * Math.min(l / 100, 1 - l / 100);
7+ const f = (n: number) => {
8+ const k = (n + h / 30) % 12;
9+ const c = l / 100 - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
10+ return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
11+ };
12+ return 0.2126 * f(0) + 0.7152 * f(8) + 0.0722 * f(4);
13+};
14+const contrastOnPage = (h: number, s: number, l: number) => (luminance(0, 0, 97) + 0.05) / (luminance(h, s, l) + 0.05);
15+
16+test("every hue gets a text shade that reads at AA on the page background", () => {
17+ for (let hue = 0; hue < 360; hue += 15) {
18+ const l = accentTextLightness(hue, 88, 40);
19+ expect(contrastOnPage(hue, 88, l)).toBeGreaterThanOrEqual(4.5);
20+ }
21+});
22+
23+test("a hue that already passes keeps the button lightness", () => {
24+ expect(accentTextLightness(240, 88, 40)).toBe(40);
25+});
src/stores/preferences-context.tsxmodified+26 -0
@@ -150,6 +150,26 @@ function foregroundFor(h: number, s: number, l: number): string {
150150 * `#fefae0`) would be nearly invisible as a light-mode button, and a near-black
151151 * pick (e.g. `#023047`) would vanish against the near-black dark background.
152152 */
153+/** WCAG contrast ratio between two relative luminances. */
154+function contrastRatio(a: number, b: number): number {
155+ const [hi, lo] = a > b ? [a, b] : [b, a];
156+ return (hi + 0.05) / (lo + 0.05);
157+}
158+
159+/**
160+ * The darkest-needed step of the light-mode accent that still reads as the
161+ * accent but reaches 4.5:1 as small text on white and on the 97% page
162+ * background. A yellow or cyan pick at the button lightness does not.
163+ */
164+export function accentTextLightness(h: number, s: number, from: number): number {
165+ const page = relativeLuminance(...hslToRgb(0, 0, 97));
166+ for (let l = from; l > 10; l -= 1) {
167+ const text = relativeLuminance(...hslToRgb(h, s, l));
168+ if (contrastRatio(text, page) >= 4.5) return l;
169+ }
170+ return 10;
171+}
172+
153173 function themedAccent(hex: string, mode: ThemeMode): { hsl: string; fg: string } {
154174 const { h, s } = hexToHslParts(hex);
155175 const sat = Math.min(88, Math.max(30, s));
@@ -209,6 +229,7 @@ export function PreferencesProvider(props: ParentProps) {
209229 removeStorage(PALETTE_COLOR_KEY);
210230 root.removeProperty("--accent-light");
211231 root.removeProperty("--accent-light-fg");
232+ root.removeProperty("--accent-light-text");
212233 root.removeProperty("--accent-dark");
213234 root.removeProperty("--accent-dark-fg");
214235 return;
@@ -221,6 +242,11 @@ export function PreferencesProvider(props: ParentProps) {
221242 const dark = themedAccent(color, "dark");
222243 root.setProperty("--accent-light", light.hsl);
223244 root.setProperty("--accent-light-fg", light.fg);
245+ {
246+ const { h, s } = hexToHslParts(color);
247+ const sat = Math.min(88, Math.max(30, s));
248+ root.setProperty("--accent-light-text", `${Math.round(h)} ${Math.round(sat)}% ${accentTextLightness(h, sat, 40)}%`);
249+ }
224250 root.setProperty("--accent-dark", dark.hsl);
225251 root.setProperty("--accent-dark-fg", dark.fg);
226252 });