Skip to content

Commit 6332984

Browse files
Adebesin-Cellclaude
andcommitted
fix(brand): use native radio inputs in Customize and dedupe classes
Resolves html-validate errors that surfaced once BrandCustomize began rendering in SSR: replace ButtonBase with role="radio" with native <input type="radio"> in labels, and drop class duplicates already provided by ButtonBase. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent a7dc645 commit 6332984

1 file changed

Lines changed: 39 additions & 41 deletions

File tree

app/components/Brand/Customize.vue

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,29 @@ 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" role="radiogroup">
147-
<ButtonBase
146+
<div class="flex items-center gap-1.5">
147+
<label
148148
v-for="color in pickerColors"
149149
:key="color.id"
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"
150+
class="relative w-6 h-6 rounded-full border-2 cursor-pointer duration-150 motion-reduce:transition-none"
154151
:class="
155152
activeAccentId === color.id
156-
? '!border-fg scale-110'
153+
? 'border-fg scale-110'
157154
: color.id === 'neutral'
158-
? '!border-border hover:!border-border-hover'
159-
: '!border-transparent hover:!border-border-hover'
155+
? 'border-border hover:border-border-hover'
156+
: 'border-transparent hover:border-border-hover'
160157
"
161158
:style="{ backgroundColor: color.value }"
162-
@click="customAccent = color.id"
163-
/>
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>
164169
</div>
165170
</fieldset>
166171

@@ -170,40 +175,33 @@ async function downloadCustomPng() {
170175
<span class="text-sm font-mono text-fg-muted">{{
171176
$t('brand.customize.bg_label')
172177
}}</span>
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"
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'"
189182
>
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-
</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"
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'"
204195
>
196+
<input
197+
v-model="customBgDark"
198+
type="radio"
199+
name="brand-customize-bg"
200+
:value="false"
201+
class="sr-only"
202+
/>
205203
{{ $t('brand.logos.on_light') }}
206-
</ButtonBase>
204+
</label>
207205
</div>
208206
</div>
209207

0 commit comments

Comments
 (0)