TypeScript
fix(web): switched-off controls stay visible in dark mode (#14984)
Guillermo Casanova8a948076bbda
diff --git a/apps/web/src/components/settings/EnvironmentRow.tsx b/apps/web/src/components/settings/EnvironmentRow.tsxindex 11da055f3d7..8794c5feedb 100644--- a/apps/web/src/components/settings/EnvironmentRow.tsx+++ b/apps/web/src/components/settings/EnvironmentRow.tsx@@ -71,12 +71,17 @@ export function EnvironmentRow({<divclassName={cn("grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 px-3 py-2.5 sm:px-4",- dimmed && "opacity-60",className,)}>- <EnvironmentMachineIcon aria-hidden kind={kind} className="size-4 text-muted-foreground" />- <div className="min-w-0">+ {/* Dim only the identity so a switched-off row's controls stay readable+ and distinct from disabled ones. */}+ <EnvironmentMachineIcon+ aria-hidden+ kind={kind}+ className={cn("size-4 text-muted-foreground", dimmed && "opacity-60")}+ />+ <div className={cn("min-w-0", dimmed && "opacity-60")}><p className="truncate text-sm font-medium text-foreground">{label}</p><div className="truncate text-xs text-muted-foreground">{subtitle}</div>{below}diff --git a/apps/web/src/components/ui/switch.tsx b/apps/web/src/components/ui/switch.tsxindex 9da5a9a3a97..88a79b5e50a 100644--- a/apps/web/src/components/ui/switch.tsx+++ b/apps/web/src/components/ui/switch.tsx@@ -30,7 +30,7 @@ function Switch({><SwitchPrimitive.ThumbclassName={cn(- "pointer-events-none block size-[calc(var(--thumb-size)-2px)] shrink-0 origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-right data-checked:translate-x-[calc(var(--thumb-size)-4px)]",+ "pointer-events-none block size-[calc(var(--thumb-size)-2px)] shrink-0 origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 dark:data-unchecked:bg-muted-foreground [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-right data-checked:translate-x-[calc(var(--thumb-size)-4px)]",mixed &&"translate-x-[calc((var(--thumb-size)-4px)/2)] opacity-70 data-checked:translate-x-[calc((var(--thumb-size)-4px)/2)]",)}