You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/material-3.md
+24-33Lines changed: 24 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,17 @@
6
6
system, Material Design. It is the successor to [Material 2 (M2)](https://m2.material.io/), the
7
7
design system which Angular Material has followed.
8
8
9
-
As of v17.2.0, Angular Material includes experimental support for M3 styling in addition to M2. The
10
-
team plans to stabilize support for M3 after a brief period in experimental in order to get feedback
11
-
on the design and API.
12
-
13
9
## How to use Material 3 in your app
14
10
15
11
M3 is implemented in Angular Material as an alternate Sass theme for the same set of Angular
16
12
Material components already used by many apps. To use M3 with Angular Material, create your theme
17
-
using the `define-theme` function from `@angular/material-experimental`, as opposed to the
13
+
using the `define-theme` function from `@angular/material`, as opposed to the
18
14
`define-light-theme` or `define-dark-theme` from `@angular/material` that are used to create M2
19
15
themes.
20
16
21
17
### Defining your theme
22
18
23
-
The simplest usage of the API, `$theme: matx.define-theme()` defines a theme with default values.
19
+
The simplest usage of the API, `$theme: mat.define-theme()` defines a theme with default values.
24
20
However, like its M2 counterparts, `define-theme` allows you to configure the appearance of your
25
21
Angular Material app along three theming dimensions: color, typography, and density, by passing a
26
22
theme configuration object. The configuration object may have the following properties.
@@ -34,12 +30,12 @@ theme configuration object. The configuration object may have the following prop
34
30
<!-- TODO(mmalerba): Upgrade to embedded example -->
35
31
36
32
```scss
37
-
@use'@angular/material-experimental'asmatx;
33
+
@use'@angular/material'asmat;
38
34
39
-
$theme: matx.define-theme((
35
+
$theme: mat.define-theme((
40
36
color: (
41
37
theme-type: dark,
42
-
primary: matx.$m3-violet-palette,
38
+
primary: mat.$violet-palette,
43
39
),
44
40
typography: (
45
41
brand-family: 'Comic Sans',
@@ -63,20 +59,20 @@ more about these terms):
63
59
|`primary`|[Optional] Specifies the palette to use for the app's primary color palette. (Note: the secondary, neutral, and neutral-variant palettes described in the M3 spec will be automatically chosen based on your primary palette, to ensure a harmonious color combination). |
64
60
|`tertiary`|[Optional] Specifies the palette to use for the app's tertiary color palette. |
65
61
66
-
There are a number of color palettes available in `@angular/material-experimental` that can be
62
+
There are a number of color palettes available in `@angular/material` that can be
67
63
used with the `primary` and `tertiary` options:
68
64
69
-
-`$m3-red-palette`
70
-
-`$m3-green-palette`
71
-
-`$m3-blue-palette`
72
-
-`$m3-yellow-palette`
73
-
-`$m3-cyan-palette`
74
-
-`$m3-magenta-palette`
75
-
-`$m3-orange-palette`
76
-
-`$m3-chartreuse-palette`
77
-
-`$m3-azure-palette`
78
-
-`$m3-violet-palette`
79
-
-`$m3-rose-palette`
65
+
-`$red-palette`
66
+
-`$green-palette`
67
+
-`$blue-palette`
68
+
-`$yellow-palette`
69
+
-`$cyan-palette`
70
+
-`$magenta-palette`
71
+
-`$orange-palette`
72
+
-`$chartreuse-palette`
73
+
-`$azure-palette`
74
+
-`$violet-palette`
75
+
-`$rose-palette`
80
76
81
77
Alternatively, a theme can be generated with a custom color with the following schematic:
82
78
@@ -161,9 +157,8 @@ can instead apply color variants by passing the `$color-variant` option to a com
0 commit comments