Skip to content

Commit 2cb88dd

Browse files
committed
Revert "fix(brand): use native radio inputs in Customize and dedupe classes"
This reverts commit 6332984.
1 parent 6332984 commit 2cb88dd

1 file changed

Lines changed: 41 additions & 39 deletions

File tree

app/components/Brand/Customize.vue

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,24 @@ async function downloadCustomPng() {
143143
<span class="text-sm font-mono text-fg-muted shrink-0">{{
144144
$t('brand.customize.accent_label')
145145
}}</span>
146-
<div class="flex items-center gap-1.5">
147-
<label
146+
<div class="flex items-center gap-1.5" role="radiogroup">
147+
<ButtonBase
148148
v-for="color in pickerColors"
149149
:key="color.id"
150-
class="relative w-6 h-6 rounded-full border-2 cursor-pointer duration-150 motion-reduce:transition-none"
150+
role="radio"
151+
:aria-checked="activeAccentId === color.id"
152+
:aria-label="color.label"
153+
class="!w-6 !h-6 !rounded-full !border-2 !p-0 !min-w-0 transition-all duration-150 motion-reduce:transition-none"
151154
:class="
152155
activeAccentId === color.id
153-
? 'border-fg scale-110'
156+
? '!border-fg scale-110'
154157
: color.id === 'neutral'
155-
? 'border-border hover:border-border-hover'
156-
: 'border-transparent hover:border-border-hover'
158+
? '!border-border hover:!border-border-hover'
159+
: '!border-transparent hover:!border-border-hover'
157160
"
158161
:style="{ backgroundColor: color.value }"
159-
:aria-label="color.label"
160-
>
161-
<input
162-
v-model="customAccent"
163-
type="radio"
164-
name="brand-customize-accent"
165-
:value="color.id"
166-
class="sr-only"
167-
/>
168-
</label>
162+
@click="customAccent = color.id"
163+
/>
169164
</div>
170165
</fieldset>
171166

@@ -175,33 +170,40 @@ async function downloadCustomPng() {
175170
<span class="text-sm font-mono text-fg-muted">{{
176171
$t('brand.customize.bg_label')
177172
}}</span>
178-
<div class="flex items-center border border-border rounded-md overflow-hidden">
179-
<label
180-
class="px-3 py-1.5 text-sm font-mono cursor-pointer motion-reduce:transition-none"
181-
:class="customBgDark ? 'bg-bg-muted text-fg' : 'text-fg-muted hover:text-fg'"
173+
<div
174+
class="flex items-center border border-border rounded-md overflow-hidden"
175+
role="radiogroup"
176+
>
177+
<ButtonBase
178+
size="md"
179+
role="radio"
180+
:aria-checked="customBgDark"
181+
:aria-label="$t('brand.logos.on_dark')"
182+
class="!border-none !rounded-none motion-reduce:transition-none"
183+
:class="
184+
customBgDark
185+
? 'bg-bg-muted text-fg'
186+
: 'bg-transparent text-fg-muted hover:text-fg'
187+
"
188+
@click="customBgDark = true"
182189
>
183-
<input
184-
v-model="customBgDark"
185-
type="radio"
186-
name="brand-customize-bg"
187-
:value="true"
188-
class="sr-only"
189-
/>
190190
{{ $t('brand.logos.on_dark') }}
191-
</label>
192-
<label
193-
class="px-3 py-1.5 text-sm font-mono cursor-pointer border-is border-is-border motion-reduce:transition-none"
194-
:class="!customBgDark ? 'bg-bg-muted text-fg' : 'text-fg-muted hover:text-fg'"
191+
</ButtonBase>
192+
<ButtonBase
193+
size="md"
194+
role="radio"
195+
:aria-checked="!customBgDark"
196+
:aria-label="$t('brand.logos.on_light')"
197+
class="!border-none !rounded-none border-is border-is-border motion-reduce:transition-none"
198+
:class="
199+
!customBgDark
200+
? 'bg-bg-muted text-fg'
201+
: 'bg-transparent text-fg-muted hover:text-fg'
202+
"
203+
@click="customBgDark = false"
195204
>
196-
<input
197-
v-model="customBgDark"
198-
type="radio"
199-
name="brand-customize-bg"
200-
:value="false"
201-
class="sr-only"
202-
/>
203205
{{ $t('brand.logos.on_light') }}
204-
</label>
206+
</ButtonBase>
205207
</div>
206208
</div>
207209

0 commit comments

Comments
 (0)