Skip to content

Commit ed0a0fa

Browse files
authored
fix(feedback): Fix cases where the outline of inputs were wrong (#18647)
The integration was using `"colorScheme: "dark"` we include css only dark mode. But some properties, like `outline` were not specified, the system does a good job by default. However, adding `color-scheme: only light` into the css meant that the light-mode outlines were used in all cases, even when we asked for dark mode. This changes things so that we have the correct values for `color-scheme` if a specific value is picked. This ensures that the `outline` and `:focus` colors set by the system are correct in all cases. **Test Plan** I tested with my system set to each of: light, dark, automatic And then with the integration setting set to each of: `colorScheme: 'light'`, `colorScheme: 'dark'` and `colorScheme: 'system'`. To test i just opened up the feedback widget and clicked to focus an input box. **Screenshots** | Before | After | | --- | --- | | <img width="443" height="199" alt="SCR-20251230-pleg" src="https://github.com/user-attachments/assets/ade46ef2-16c0-4de8-b630-6ac0cf66f440" /> | <img width="466" height="275" alt="SCR-20251230-plch" src="https://github.com/user-attachments/assets/a6ddbcbe-9d1b-4515-9833-84c62f0e6ed9" />
1 parent 4aa907e commit ed0a0fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/feedback/src/core/createMainStyles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function createMainStyles({
7171
font-family: var(--font-family);
7272
font-size: var(--font-size);
7373
74-
${colorScheme !== 'system' ? 'color-scheme: only light;' : ''}
74+
${colorScheme !== 'system' ? `color-scheme: only ${colorScheme};` : ''}
7575
7676
${getThemedCssVariables(
7777
colorScheme === 'dark' ? { ...DEFAULT_DARK, ...themeDark } : { ...DEFAULT_LIGHT, ...themeLight },
@@ -83,12 +83,13 @@ ${
8383
? `
8484
@media (prefers-color-scheme: dark) {
8585
:host {
86+
color-scheme: only dark;
87+
8688
${getThemedCssVariables({ ...DEFAULT_DARK, ...themeDark })}
8789
}
8890
}`
8991
: ''
9092
}
91-
}
9293
`;
9394

9495
if (styleNonce) {

0 commit comments

Comments
 (0)