Skip to content

Commit 792b3fe

Browse files
authored
update incorrect image, fix some formatting (#3478)
* update incorrect image, fix some formatting * delete obsolete image
1 parent 44f9821 commit 792b3fe

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

hub/apps/design/style/acrylic.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn to use acrylic, a type of brush that creates a translucent texture to add depth and help establish a visual hierarchy.
33
title: Acrylic material
44
template: detail.hbs
5-
ms.date: 09/24/2020
5+
ms.date: 03/30/2023
66
ms.topic: article
77
keywords: windows 10, uwp
88
pm-contact: yulikl
@@ -37,7 +37,7 @@ Acrylic in dark theme
3737
## Examples
3838

3939
:::row:::
40-
:::column span:::
40+
:::column:::
4141
![Some image](images/xaml-controls-gallery-app-icon.png)
4242
:::column-end:::
4343
:::column span="2":::
@@ -50,9 +50,11 @@ If you have the WinUI 2 Gallery app installed, click <a href="winui2gallery:/ite
5050
:::row-end:::
5151

5252
## Acrylic blend types
53+
5354
Acrylic's most noticeable characteristic is its transparency. There are two acrylic blend types that change what’s visible through the material:
54-
- **Background acrylic** reveals the desktop wallpaper and other windows that are behind the currently active app, adding depth between application windows while celebrating the user’s personalization preferences.
55-
- **In-app acrylic** adds a sense of depth within the app frame, providing both focus and hierarchy.
55+
56+
- **Background acrylic** reveals the desktop wallpaper and other windows that are behind the currently active app, adding depth between application windows while celebrating the user’s personalization preferences.
57+
- **In-app acrylic** adds a sense of depth within the app frame, providing both focus and hierarchy.
5658

5759
![Background acrylic](images/background-acrylic-dark-theme.png)
5860

@@ -77,30 +79,34 @@ For vertical panes or surfaces that help section off content of your app, we rec
7779

7880
For apps with context menus, flyouts, non-modal popups, or light-dismiss panes, it is recommended to use background acrylic, especially if these surfaces draw outside the frame of the main app window.
7981

80-
![Mail app pattern using an informational flyout](images/mail-transient-context-menu.png)
82+
![The desktop background showing through an open context menu using background acrylic](images/acrylic-transient-context-menu.png)
8183

8284
Many XAML controls draw acrylic by default. [MenuFlyout](../controls/menus.md), [AutoSuggestBox](../controls/auto-suggest-box.md), [ComboBox](/uwp/api/windows.ui.xaml.controls.combobox), and similar controls with light-dismiss popups all use acrylic while open.
8385

84-
> [!Note]
86+
> [!NOTE]
8587
> Rendering acrylic surfaces is GPU-intensive, which can increase device power consumption and shorten battery life. Acrylic effects are automatically disabled when a device enters Battery Saver mode. Users can disable acrylic effects for all apps by turning off _Transparency effects_ in Settings > Personalization > Colors.
8688
8789
## Usability and adaptability
90+
8891
Acrylic automatically adapts its appearance for a wide variety of devices and contexts.
8992

9093
In High Contrast mode, users continue to see the familiar background color of their choosing in place of acrylic. In addition, both background acrylic and in-app acrylic appear as a solid color:
91-
- When the user turns off _Transparency effects_ in Settings > Personalization > Colors.
92-
- When Battery Saver mode is activated.
93-
- When the app runs on low-end hardware.
94+
95+
- When the user turns off _Transparency effects_ in Settings > Personalization > Colors.
96+
- When Battery Saver mode is activated.
97+
- When the app runs on low-end hardware.
9498

9599
In addition, only background acrylic will replace its translucency and texture with a solid color:
96-
- When an app window on desktop deactivates.
97-
- When the app is running on Xbox, HoloLens, or in tablet mode.
100+
101+
- When an app window on desktop deactivates.
102+
- When the app is running on Xbox, HoloLens, or in tablet mode.
98103

99104
### Legibility considerations
100105

101106
It’s important to ensure that any text your app presents to users meets contrast ratios (see [Accessible text requirements](../accessibility/accessible-text-requirements.md)). We’ve optimized the acrylic resources such that text meets contrast ratios on top of acrylic. We don't recommend placing accent-colored text on your acrylic surfaces because these combinations are likely to not pass minimum contrast ratio requirements at the default 14px font size. Try to avoid placing [hyperlinks](../controls/hyperlinks.md) over acrylic elements. Also, if you choose to customize the acrylic tint color or opacity level, keep the impact on legibility in mind.
102107

103108
## Acrylic theme resources
109+
104110
You can easily apply acrylic to your app’s surfaces using the XAML [AcrylicBrush](/windows/winui/api/microsoft.ui.xaml.media.acrylicbrush) or predefined AcrylicBrush theme resources. First, you’ll need to decide whether to use in-app or background acrylic. Be sure to review common app patterns described earlier in this article for recommendations.
105111

106112
We’ve created a collection of brush theme resources for both background and in-app acrylic types that respect the app’s theme and fall back to solid colors as needed. For WinUI 2, these theme resources are located in the [AcrylicBrush themeresources file, in the microsoft-ui-xaml GitHub repo](https://github.com/microsoft/microsoft-ui-xaml/blob/6aed8d97fdecfe9b19d70c36bd1dacd9c6add7c1/dev/Materials/Acrylic/AcrylicBrush_19h1_themeresources.xaml#L11). Resources that include *Background* in their names represent background acrylic, while *InApp* refers to in-app acrylic.
@@ -112,12 +118,14 @@ To paint a specific surface, apply one of the WinUI 2 theme resources to element
112118
```
113119

114120
## Custom acrylic brush
121+
115122
You may choose to add a color tint to your app’s acrylic to show branding or provide visual balance with other elements on the page. To show color rather than greyscale, you’ll need to define your own acrylic brushes using the following properties.
116-
- **TintColor**: the color/tint overlay layer.
117-
- **TintOpacity**: the opacity of the tint layer.
118-
- **TintLuminosityOpacity**: controls the amount of saturation that is allowed through the acrylic surface from the background.
119-
- **BackgroundSource**: the flag to specify whether you want background or in-app acrylic.
120-
- **FallbackColor**: the solid color that replaces acrylic in Battery Saver. For background acrylic, fallback color also replaces acrylic when your app isn’t in the active desktop window or when the app is running on phone and Xbox.
123+
124+
- **TintColor**: the color/tint overlay layer.
125+
- **TintOpacity**: the opacity of the tint layer.
126+
- **TintLuminosityOpacity**: controls the amount of saturation that is allowed through the acrylic surface from the background.
127+
- **BackgroundSource**: the flag to specify whether you want background or in-app acrylic.
128+
- **FallbackColor**: the solid color that replaces acrylic in Battery Saver. For background acrylic, fallback color also replaces acrylic when your app isn’t in the active desktop window or when the app is running on phone and Xbox.
121129

122130
![Light theme acrylic swatches](images/custom-acrylic-swatches-light-theme.png)
123131

@@ -127,7 +135,7 @@ You may choose to add a color tint to your app’s acrylic to show branding or p
127135

128136
To add an acrylic brush, define the three resources for dark, light and high contrast themes. Note that in high contrast, we recommend using a SolidColorBrush with the same x:Key as the dark/light AcrylicBrush.
129137

130-
> [!Note]
138+
> [!NOTE]
131139
> If you don't specify a TintLuminosityOpacity value, the system will automatically adjust its value based on your TintColor and TintOpacity.
132140
133141
```xaml
@@ -240,6 +248,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
240248
In addition, you'll need to draw your app's title, which normally appears automatically in the title bar, with a TextBlock using `CaptionTextBlockStyle`. For more info, see [Title bar customization](../../develop/title-bar.md).
241249

242250
## Do's and don'ts
251+
243252
* Do use acrylic on transient surfaces.
244253
* Do extend acrylic to at least one edge of your app to provide a seamless experience by subtly blending with the app’s surroundings.
245254
* Don't put desktop acrylic on large background surfaces of your app.
480 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)