From 1bb70e638065ee8b0b88e76939369c5d13466207 Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Sun, 20 Apr 2025 21:34:47 +0200 Subject: [PATCH] style: improve tab background color logic --- app/components/Snippet.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/Snippet.tsx b/app/components/Snippet.tsx index cbeec3b..74e7811 100644 --- a/app/components/Snippet.tsx +++ b/app/components/Snippet.tsx @@ -72,9 +72,10 @@ export function Snippet(props: SnippetProps) { type="button" class={clsx( "flex items-center rounded-full px-2.5", - isActive(tab) && props.dark - ? "bg-slate-800" - : "bg-violet-100", + isActive(tab) && { + "bg-slate-800": props.dark, + "bg-violet-100": !props.dark, + }, )} disabled={!tab.codeLanguage} onClick={() => selectTab(tab.name)}