Set theme (dark/light) setting #3955
Replies: 2 comments 1 reply
-
prefers-color-scheme is supported and will use the NOTE: This requires an app.manifest with For reference chromiumembedded/cef#2824
Are you using a If you are trying to implement this behaviour independent of the using (var devToolsClient = chromiumWebBrowser.GetDevToolsClient())
{
await devToolsClient.Emulation.SetAutoDarkModeOverrideAsync(true);
} UPDATE: CEF now supports See https://github.com/cefsharp/CefSharp/wiki/General-Usage#cefsettings-and-browsersettings for generic example of setting command line argument programmatically. (Don't include //Force Light mode
settings.CefCommandLineArgs.Add("force-light-mode");
//Force Dark mode
settings.CefCommandLineArgs.Add("force-dark-mode"); |
Beta Was this translation helpful? Give feedback.
-
Team, This is working for me, I tried a couple of websites and observed no issues.
Let me know, if this helps! |
Beta Was this translation helpful? Give feedback.
-
I have a WPF app that can be used in either Dark theme or light theme. One of the views consists of CefSharp.Wpf.ChromiumWebBrowser.
Right now, the embedded web browser is always light, even if the WPF app uses dark theme. Is it possible to set the embedded web browser theme settings via the ChromiumWebBrowser instance from the WPF app, so that the embedded web browser will be viewed in dark theme when WPF uses dark theme and viewed in light theme when WPF uses light theme?
Beta Was this translation helpful? Give feedback.
All reactions