microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.35k stars 1.14k forks source link

PlatformColor Doesn't Respect Appearance.setColorScheme #13279

Open MicrosoftNik opened 5 months ago

MicrosoftNik commented 5 months ago

Problem Description

Our app relies on the system visual theme instead of the app visual theme but by default PlatformColor uses the app visual theme. I tried setting the color scheme to dark while the app visual scheme was light by using Appearance.setColorScheme as a workaround but this had no effect on PlatformColor which continued using the light theme when used with a brush.

Steps To Reproduce

  1. Call Appearance.setColorScheme("dark") while the app theme is set to "light" (Settings -> Personalization -> Colors).
  2. Pass a brush to PlatformColor that has both light and dark theme colors.
  3. Observe that PlatformColor continues using the brushes for "light" theme instead of "dark".

Expected Results

No response

CLI version

npx react-native -v

Environment

npx react-native info

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

jonthysell commented 5 months ago

Right now the set method doesn't do anything IRRC because XAML can't change the app theme at runtime. Maybe we can fix this in Fabric?

sgmuiruri commented 4 months ago

Right now the set method doesn't do anything IRRC because XAML can't change the app theme at runtime. Maybe we can fix this in Fabric?

any updates on this bug fix?