From e29d161468535c016380d30b13760425611c8d4f Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 1 Feb 2024 13:38:44 -0500 Subject: [PATCH] fix(feedback): Fix logo color when colorScheme is "system" The CSS when colorScheme is "system" was always being overwritten so the logo color ends up being incorrect when OS is in dark mode. --- packages/feedback/src/widget/Logo.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/feedback/src/widget/Logo.ts b/packages/feedback/src/widget/Logo.ts index 17333bda87ed..9e286a970961 100644 --- a/packages/feedback/src/widget/Logo.ts +++ b/packages/feedback/src/widget/Logo.ts @@ -33,8 +33,13 @@ export function Logo({ colorScheme }: Props): IconReturn { const defs = createElementNS('defs'); const style = createElementNS('style'); + style.textContent = ` + path { + fill: ${colorScheme === 'dark' ? '#fff' : '#362d59'}; + }`; + if (colorScheme === 'system') { - style.textContent = ` + style.textContent += ` @media (prefers-color-scheme: dark) { path: { fill: '#fff'; @@ -43,11 +48,6 @@ export function Logo({ colorScheme }: Props): IconReturn { `; } - style.textContent = ` - path { - fill: ${colorScheme === 'dark' ? '#fff' : '#362d59'}; - }`; - defs.append(style); svg.append(defs);