feat(theme): R10 S1 — semantic status colors (danger/warn/success)

Add theme-scoped --danger/--warn/--success (+ -fg) tokens wired into the v4
@theme inline, replacing ~110 raw red/amber/emerald/green palette refs across
34 files. Fixes light-theme contrast failures (fixed Tailwind shades fell to
~1.7-3:1 on white). Status colors are scheme-independent — recognised by hue,
shifting only by theme to hold contrast (bright on dark bg, darkened on light).
Solid fills use the paired -fg text; @source inline guarantees the full -fg set
exists. IMDb rating gold kept as a deliberate decorative non-status exception.
This commit is contained in:
2026-08-09 01:03:53 +02:00
parent 9ca0c61ea9
commit d794524adf
35 changed files with 123 additions and 85 deletions
+6 -6
View File
@@ -45,9 +45,9 @@ const GiB = 1024 ** 3;
const STATUS_CLS: Record<string, string> = {
queued: "text-muted",
running: "text-accent",
paused: "text-amber-400",
done: "text-emerald-400",
error: "text-red-400",
paused: "text-warn",
done: "text-success",
error: "text-danger",
canceled: "text-muted",
};
@@ -137,7 +137,7 @@ function IconBtn({
title={title}
className={clsx(
"p-1.5 rounded-md hover:bg-surface text-muted transition",
danger ? "hover:text-red-400" : "hover:text-fg",
danger ? "hover:text-danger" : "hover:text-fg",
)}
>
{children}
@@ -253,7 +253,7 @@ function DownloadRow({
{job.status === "error" ? (
<button
onClick={() => onShowError?.(job)}
className="text-red-400 hover:text-red-300 inline-flex items-center gap-1 truncate"
className="text-danger hover:text-danger inline-flex items-center gap-1 truncate"
title={t("downloads.errors.fail.title")}
>
· {t(`downloads.errors.fail.cat.${job.error_code || "unknown"}.short`)}
@@ -492,7 +492,7 @@ function UsageBar() {
{!u.unlimited && (
<div className="h-2 rounded-full bg-surface overflow-hidden">
<div
className={clsx("h-full transition-all", pct > 90 ? "bg-red-400" : "bg-accent")}
className={clsx("h-full transition-all", pct > 90 ? "bg-danger" : "bg-accent")}
style={{ width: `${pct}%` }}
/>
</div>