From 987b33dbb42111a5c5230470202427bc2fc07687 Mon Sep 17 00:00:00 2001 From: Blomios Date: Sat, 12 Sep 2026 16:22:13 +0200 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20renforce=20la=20couleur=20proj?= =?UTF-8?q?et=20dans=20les=20onglets=20non=20s=C3=A9lectionn=C3=A9s=20?= =?UTF-8?q?=E2=80=94=20teinte=20inactive=205%=20(+25%=20vs=204%),=20hover?= =?UTF-8?q?=20th=C3=A9matis=C3=A9,=20actif=20pr=C3=A9serv=C3=A9=20?= =?UTF-8?q?=E2=80=94=20#339=20(QA=20verte)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/shared/ui/Tabs.tsx | 38 +++++++++++++++++++++--------- frontend/src/shared/ui/ui.test.tsx | 29 +++++++++++++++++++++++ 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/frontend/src/shared/ui/Tabs.tsx b/frontend/src/shared/ui/Tabs.tsx index 902971b0..3615d202 100644 --- a/frontend/src/shared/ui/Tabs.tsx +++ b/frontend/src/shared/ui/Tabs.tsx @@ -7,9 +7,15 @@ import { cn } from "../lib/cn"; import { IconButton } from "./IconButton"; -import type { ReactNode } from "react"; +import type { CSSProperties, ReactNode } from "react"; import { useI18n } from "@/i18n"; +interface ThemedTabStyle extends CSSProperties { + "--tab-theme-active-bg": string; + "--tab-theme-inactive-bg": string; + "--tab-theme-hover-bg": string; +} + export interface TabItem { /** Stable id, returned by `onSelect`/`onClose`. */ id: string; @@ -44,22 +50,32 @@ export function Tabs({ items, value, onSelect, onClose, className }: TabsProps) > {items.map((tab) => { const active = tab.id === value; + const themedStyle: ThemedTabStyle | undefined = tab.themeColor + ? { + "--tab-theme-active-bg": `color-mix(in srgb, var(--color-raised) 90%, ${tab.themeColor})`, + // 5% project colour is 25% stronger than the previous 4% tint. + "--tab-theme-inactive-bg": `color-mix(in srgb, var(--color-raised) 95%, ${tab.themeColor})`, + "--tab-theme-hover-bg": `color-mix(in srgb, var(--color-raised) 93%, ${tab.themeColor})`, + ...(active ? { borderColor: tab.themeAccent ?? tab.themeColor } : {}), + } + : undefined; return (