Skip to content

Commit bf2f39c

Browse files
NicolappsConvex, Inc.
authored andcommitted
dash: fix the focused style for the theme selector (#43104)
The current active style is too similar to our focus style on buttons. GitOrigin-RevId: 5e5c9177fe9a5e9d460a6f54df3124b7ddf2f61e
1 parent b74e9cc commit bf2f39c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

npm-packages/dashboard/src/pages/profile.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,21 @@ function ToggleDarkMode() {
186186
<RadioGroup.Option
187187
key={theme.title}
188188
value={theme.value}
189-
className={({ checked, active }) =>
189+
className={({ checked }) =>
190190
classNames(
191-
checked ? "border-transparent" : "",
192-
active ? "" : "",
193-
"relative block cursor-pointer rounded-2xl border px-6 py-4 focus:outline-hidden sm:flex sm:justify-between",
194-
"bg-background-primary/30 hover:bg-background-primary/70 transition-colors shadow-sm border",
191+
"relative block cursor-pointer rounded-2xl border px-6 py-4 focus:outline-none sm:flex sm:justify-between",
192+
checked
193+
? "[--theme-selector-border:var(--border-transparent)]"
194+
: "[--theme-selector-border:transparent]",
195+
"focus-visible:[--theme-selector-border:var(--border-selected)]",
196+
"bg-background-primary/30 hover:bg-background-primary/70 transition-colors shadow-sm",
197+
checked
198+
? "bg-background-tertiary"
199+
: "bg-background-secondary",
195200
)
196201
}
197202
>
198-
{({ checked, active }) => (
203+
{({ checked }) => (
199204
<>
200205
<span className="flex flex-1">
201206
<span className="flex flex-col">
@@ -213,8 +218,7 @@ function ToggleDarkMode() {
213218
/>
214219
<span
215220
className={classNames(
216-
active ? "ring-2 ring-util-accent" : "border",
217-
checked ? "border-border-selected" : "border-transparent",
221+
"border border-(--theme-selector-border)",
218222
"pointer-events-none absolute -inset-px rounded-2xl",
219223
)}
220224
aria-hidden="true"

0 commit comments

Comments
 (0)