Skip to content

Commit 50f9a9b

Browse files
billyvgonurtemizkan
authored andcommitted
fix(feedback): Fix logo color when colorScheme is "system" (#10465)
The CSS when colorScheme is "system" was always being overwritten so the logo color ends up being incorrect when OS is in dark mode. ![image](https://github.com/getsentry/sentry-javascript/assets/79684/062b3e1d-d310-470c-93f0-53105cfb89de)
1 parent 7fd011c commit 50f9a9b

File tree

1 file changed

+6
-6
lines changed
  • packages/feedback/src/widget

1 file changed

+6
-6
lines changed

packages/feedback/src/widget/Logo.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ export function Logo({ colorScheme }: Props): IconReturn {
3333
const defs = createElementNS('defs');
3434
const style = createElementNS('style');
3535

36+
style.textContent = `
37+
path {
38+
fill: ${colorScheme === 'dark' ? '#fff' : '#362d59'};
39+
}`;
40+
3641
if (colorScheme === 'system') {
37-
style.textContent = `
42+
style.textContent += `
3843
@media (prefers-color-scheme: dark) {
3944
path: {
4045
fill: '#fff';
@@ -43,11 +48,6 @@ export function Logo({ colorScheme }: Props): IconReturn {
4348
`;
4449
}
4550

46-
style.textContent = `
47-
path {
48-
fill: ${colorScheme === 'dark' ? '#fff' : '#362d59'};
49-
}`;
50-
5151
defs.append(style);
5252
svg.append(defs);
5353

0 commit comments

Comments
 (0)