-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix Button visibility in dark mode (#15521) #15528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix Button visibility in dark mode (#15521) #15528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the below comments. Good otherwise.
|
Please rename the PR to reflect the actual thing it does: Fix background color in dark mode. The fact that buttons become visible in dark mode due to this change is a side effect. The change itself does nothing about button. |
|
Please bring back and fill-up the release notes section about background colour fixed to respect dark mode now. |
acoates-ms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break Office. We have a bunch of scenarios where we are hosting transparent UI as ReactNative content that forcing a background on will prevent that kind of UI from working.
Maybe we can add a background into the app template above the reactnative island?
Description
When using a simple
<Button>component in React Native Windows (New Architecture/Fabric), the button becomes invisible in dark mode:Root Cause
WinUI's Fluent Design system uses semi-transparent colors for controls. For example:
ControlFillColorDefault(Button background) = 6% white in dark modeIn native WinUI apps:
#202020in dark mode)In React Native Windows:
Solution
This PR adds a theme-aware background color to the
ReactNativeIslandroot visual usingSolidBackgroundFillColorBase:#F3F3F3(light gray)#202020(dark gray)This ensures semi-transparent WinUI control colors render correctly, matching native WinUI app behavior.
Changes
UpdateRootVisualBackground()method that sets the theme backgroundTesting
Impact
Breaking Changes
None - This change adds default behavior that matches user expectations and native WinUI apps.
Behavioral Changes
Components Affected
All components using semi-transparent WinUI colors will now render correctly:
PlatformColorwith semi-transparent valuesScreenshots
fixed_ddd.mp4
Microsoft Reviewers: Open in CodeFlow