I recently experimented with various GTK themes using Tweaks on my elementary OS laptop. Since then, I've been encountering an issue with Microsoft Edge where it fails to retain its theme correctly. I am currently using the WhiteSur-Dark GTK theme. Upon launching Edge, it consistently starts in light mode, despite having dark mode selected in its Settings. To switch back to dark mode, I need to click on the light mode option and then click on dark mode again. However, upon closing the browser, it reverts to light mode again. Interestingly, the system title bar remains in dark mode throughout.
To resolve this issue, I initially attempted a workaround. I copied the GTK theme files to
~/local/share/themes/<theme-name>/gtk-3.0 (Where Elementary Tweaks says to keep all the themes. Previously I was keeping them in
home/.themes and it showed up in Tweaks anyways), and then changed the theme in Tweaks to a different one from official Elementary themes. Afterward, I set the theme back to Whitesur-Dark, and this successfully restored Edge's dark mode functionality. However, after restarting my system, the problem resurfaced, and repeating the same copy-and-revert process no longer works. Being new to the Linux world, I have limited knowledge about how deeply GTK theming can affect other applications.
I've tried to install other Microsoft Edge version to see if it persists and surely did. Microsoft Edge Dev also shows the same behaiviour. I tried to launch the browser from terminal with force dark mode parameters and it does nothing. I have reported it to Microsoft Edge but it seems something to do with GTK or how theming works in Elementary at all. Because even after using that Whitesur-Dark theme Dark mode is a hit and miss across apps, even in System apps. For example Mail, Calender, Photos all supports it but Music, Calculator is still in light mode. I was not bothered by it that much but having my daily driver browser in constant Light mode and being overriden by some unkown (to me) parameter somewhere in the system theming is a deal breaker now. Here's Edge after launch:
and here's the expected behaviour:
Microsoft Edge Version: 114.0.1823.37 (Official build) (64-bit)
elementary OS 7 Horus
I would greatly appreciate any guidance or insights into this issue. Thank you!