Skip to content

Commit 059068a

Browse files
final api review changes
1 parent 33fc835 commit 059068a

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

specs/Theme.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Theme API
33

44
# Background
55
This API's main use is to set the overall theme for WebView2. The options are similar to Edge: match the system default theme, change to light theme, or change to dark theme.
6-
This API has 2 main changes relevant to the end users. First, it sets theme for WebView2 UI like dialogs, prompts, context menu, etc. And second, this API sets the ['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) [media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#media_features). Websites typically media query for this setting in order to set CSS themes for light/dark.
6+
This API has 2 main changes relevant to the end users. First, it sets the theme for WebView2 UI like dialogs, prompts, context menu, etc. And second, this API sets the ['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) [media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#media_features). Websites typically media query for this setting in order to set CSS themes for light/dark.
77

88
Please note this API will only set the overall appearance, but not theme as defined in the Edge browser.
99
For reference, in the screenshot below, this API is meant to expose the Overall Appearance section as a WebView2 API.
@@ -62,12 +62,14 @@ void SetTheme(CoreWebView2ThemeKind value)
6262
```cpp
6363
[uuid(5f817cce-5d36-4cd0-a1d5-aaaf95c8685f), object, pointer_default(unique)]
6464
interface ICoreWebView2Profile3 : ICoreWebView2Profile2 {
65-
/// The Theme property sets the overall theme of the WebView2 instance.
66-
/// The input parameter is either COREWEBVIEW2_THEME_KIND_SYSTEM,
67-
/// COREWEBVIEW2_THEME_KIND_LIGHT, or COREWEBVIEW2_THEME_KIND_DARK.
68-
/// Note that this API applies theme to WebView2 pages, dialogs, and menus
69-
/// by setting the media feature `prefers-color-scheme` for websites to
70-
/// respond to.
65+
/// The Theme property sets the overall theme of the WebView2's associated
66+
/// with this profile. This sets the theme for WebView2 UI like dialogs,
67+
/// prompts, context menus, and so on. Additionally, this sets the
68+
/// ['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
69+
/// CSS media feature.
70+
///
71+
/// The default value for this is COREWEBVIEW2_THEME_KIND_SYSTEM, which will
72+
/// follow whatever theme Windows is currently set to.
7173
///
7274
/// \snippet ViewComponent.cpp SetTheme
7375
/// Returns the value of the `Theme` property.
@@ -115,7 +117,7 @@ namespace Microsoft.Web.WebView2.Core
115117
116118
[interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2Profile3")]
117119
{
118-
[doc_string("The Theme property sets the overall theme of the WebView2 instance. The input parameter is either CoreWebView2ThemeKind.System, CoreWebView2ThemeKind.Light, or CoreWebView2ThemeKind.Dark. Note that this API applies theme to WebView2 pages, dialogs, and menus by setting the media feature `prefers-color-scheme` for websites to respond to.")]
120+
[doc_string("The Theme property sets the overall theme of the WebView2's associated with this profile. This sets the theme for WebView2 UI like dialogs, prompts, context menus, and so on. Additionally, this sets the ['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) CSS media feature. The default value for this is COREWEBVIEW2_THEME_KIND_SYSTEM, which will follow whatever theme Windows is currently set to.")]
119121
CoreWebView2ThemeKind Theme { get; set };
120122
}
121123
}

0 commit comments

Comments
 (0)