-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
Electron currently lacks the ability to detect the Windows system/shell color theme that controls the taskbar, Start menu, and other OS shell elements. The existing nativeTheme.shouldUseDarkColors
only detects the Windows application color mode setting, which can be configured separately from the system theme.
This limitation creates a disconnect for Electron applications that aim to provide a truly native experience. Users can have light mode applications with a dark taskbar (or vice versa), but Electron apps have no built-in way to detect or respond to this system-level setting.
💡 There's already a PR that completed the ask (see below), so remaining work as I see it is:
- ensure appropriate values are provided for macOS and Linux
- API name review/renaming exercise
Proposed Solution
Expose Chromium ShouldUseDarkColorsForSystemIntegratedUI
property.
https://source.chromium.org/chromium/chromium/src/+/main:ui/native_theme/native_theme_win.cc;l=1689-1708
Or add a new property shouldUseDarkColorsInSystemIntegratedUI
to the nativeTheme
API:
console.log(nativeTheme.shouldUseDarkColorsInSystemIntegratedUI) // true | false
This would enable Electron developers to:
- Create window frames that match the taskbar appearance (e.g., fly-outs, notifications)
- Adjust system-adjacent UI elements to match the shell theme (e.g., system tray icons)
- Provide a fully coherent visual experience that respects all user preferences
The implementation details are flexible, but the core need is to expose this system-level theme information somehow.
Alternatives Considered
- Raw registry access: Directly reading well-known Windows registry values, which requires Electron non-idiomatic / native code
- User configuration: Simply asking users to manually set preferences, which provides a very poor user experience
Additional Information
I've created an Electron Fiddle demonstrating the issue and compiled screenshots showing the discrepancy between application and system theme settings in Windows.
https://gist.github.com/riverar/feae53c60539cb162738de69a93e1e70
This is a basic OS integration feature that should be part of Electron's core functionality. While it may require extending what's available in the Chromium code-base, that's precisely the value Electron provides - enhancing Chromium for application development. A framework designed for desktop applications should support the bare necessities to ensure an OS-native experience.
Related issues and prior work:
#19729
#31898
https://source.chromium.org/chromium/chromium/src/+/main:ui/native_theme/native_theme_win.cc;l=1689-1708
Highly related PR that can be tweaked and merged: