Skip to content

Commit 7f07fcb

Browse files
committed
fix: use contrast-appropriate accent colors based on preview background
When the customizer is set to light background, use the light-mode accent palette so colors like neutral render as dark instead of white-on-white.
1 parent 22c3bb1 commit 7f07fcb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/components/Brand/Customize.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<script setup lang="ts">
2+
import { ACCENT_COLORS, type AccentColorId } from '#shared/utils/constants'
3+
24
const { accentColors, selectedAccentColor } = useAccentColor()
3-
const { convert: _convert, download: downloadBlob } = useSvgToPng()
5+
const { download: downloadBlob } = useSvgToPng()
46
57
const customAccent = ref<string | null>(null)
68
const customBgDark = ref(true)
79
const customLogoRef = useTemplateRef('customLogoRef')
810
911
const activeAccentId = computed(() => customAccent.value ?? selectedAccentColor.value ?? 'sky')
1012
const activeAccentColor = computed(() => {
11-
const match = accentColors.value.find(c => c.id === activeAccentId.value)
12-
const fallback = accentColors.value[0]?.value ?? 'oklch(0.787 0.128 230.318)'
13-
return match?.value ?? fallback
13+
// Use light accent colors on light bg for proper contrast (e.g. neutral: dark on white, not white on white)
14+
const palette = customBgDark.value ? ACCENT_COLORS.dark : ACCENT_COLORS.light
15+
return palette[activeAccentId.value as AccentColorId] ?? palette.sky
1416
})
1517
1618
function getCustomSvgString(): string {

0 commit comments

Comments
 (0)