Skip to content

Fix ImageColourSchemeSwitch ignoring OS dark scheme in system mode - #337

Open
zoharma wants to merge 1 commit into
mainfrom
zma/fix-image-colour-scheme-system-mode
Open

zoharma wants to merge 1 commit into
mainfrom
zma/fix-image-colour-scheme-system-mode

Conversation

@zoharma

@zoharma zoharma commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Issue

ImageColourSchemeSwitch (and so Logo) shows the light image when the OS is in dark mode and the user hasn't picked a mode.

It decides on useColorScheme().mode, which stays "system" until a mode is chosen, so mode === "dark" is false even when the page renders dark. Seen in an app on 0.7.2-rc.0: the page had data-mode="dark", but the light logo sat on a dark header.

This seems to be the case since v0.6.0.

Fix

  • Use the resolved colorScheme instead of mode
  • Base data-testid on the same value
  • Add a regression test for system mode with OS dark preference
  • Add a changelog entry

ColourSchemeButton is the only other user of useColorScheme, and it already handles "system".

Consumer note

Apps passing fixedTone as a workaround can remove it once this is released.

- Use resolved `colorScheme` instead of `mode`
- Add regression test and changelog entry
@zoharma zoharma added this to the 0.7.3 milestone Oct 2, 2026
@zoharma
zoharma requested a review from a team October 2, 2026 11:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant