2
2
defining a custom theme. Angular Material’s theming system is inspired by
3
3
Google’s < a href ="https://m3.material.io/styles "> Material Design</ a > .</ p >
4
4
< p > This guide describes how to set up theming for your application using
5
- Sass APIs introduced in Angular Material v19. </ p >
5
+ Sass APIs introduced in Angular Material v19.</ p >
6
6
< p > If your application depends on a version before v19, or if your application's
7
- theme is applied using a theme config created with < code > mat.define-theme</ code > ,
7
+ theme is applied using a theme config created with < code > mat.define-theme</ code > ,
8
8
< code > mat.define-light-theme</ code > , or < code > mat.define-dark-theme</ code > ,
9
- then you can refer to the theming guides at
9
+ then you can refer to the theming guides at
10
10
< a href ="https://v18.material.angular.dev/guides "> v18.material.angular.dev/guides</ a > .</ p >
11
11
12
12
< h2 id ="getting-started " class ="docs-header-link ">
@@ -49,7 +49,7 @@ <h2 id="getting-started" class="docs-header-link">
49
49
50
50
< h3 id ="color " class ="docs-header-link ">
51
51
< span header-link ="color "> </ span >
52
- < strong > Color</ strong >
52
+ Color
53
53
</ h3 >
54
54
< p > The < code > theme</ code > ‘s color determines the component color styles, such as the fill
55
55
color of checkboxes or ripple color of buttons. It depends on color palettes of
@@ -62,7 +62,7 @@ <h3 id="color" class="docs-header-link">
62
62
63
63
< h4 id ="single-color-palette " class ="docs-header-link ">
64
64
< span header-link ="single-color-palette "> </ span >
65
- < em > Single Color Palette</ em >
65
+ Single Color Palette
66
66
</ h4 >
67
67
< p > If you provide a single color palette, Angular Material uses its values for the
68
68
theme’s primary, secondary, and tertiary colors. The CSS color values will be
@@ -71,7 +71,7 @@ <h4 id="single-color-palette" class="docs-header-link">
71
71
72
72
< h4 id ="color-map " class ="docs-header-link ">
73
73
< span header-link ="color-map "> </ span >
74
- < em > Color Map</ em >
74
+ Color Map
75
75
</ h4 >
76
76
< p > If you provide a color map, then the tertiary color palette can be configured
77
77
separately from the primary palette. The tertiary palette can be used to add a
@@ -107,7 +107,7 @@ <h4 id="color-map" class="docs-header-link">
107
107
}</ code > </ pre >
108
108
< h3 id ="typography " class ="docs-header-link ">
109
109
< span header-link ="typography "> </ span >
110
- < strong > Typography</ strong >
110
+ Typography
111
111
</ h3 >
112
112
< p > The < code > mat.theme</ code > ‘s typography determines the text styles used in components,
113
113
such as the font for dialog titles or menu list items.</ p >
@@ -116,15 +116,15 @@ <h3 id="typography" class="docs-header-link">
116
116
117
117
< h4 id ="single-font-family-value " class ="docs-header-link ">
118
118
< span header-link ="single-font-family-value "> </ span >
119
- < em > Single Font Family Value</ em >
119
+ Single Font Family Value
120
120
</ h4 >
121
121
< p > If you provide a font family, Angular Material uses it for all the text in its
122
122
components. The font weights used in components are set to 700 for bold text,
123
123
500 for medium text, and 400 for regular text.</ p >
124
124
125
125
< h4 id ="typography-map " class ="docs-header-link ">
126
126
< span header-link ="typography-map "> </ span >
127
- < em > Typography Map</ em >
127
+ Typography Map
128
128
</ h4 >
129
129
< p > If you provide a typography map, then distinct font families are set for plain
130
130
and brand text. The plain font family is typically used for most of the
@@ -153,7 +153,7 @@ <h4 id="typography-map" class="docs-header-link">
153
153
}</ code > </ pre >
154
154
< h3 id ="density " class ="docs-header-link ">
155
155
< span header-link ="density "> </ span >
156
- < strong > Density</ strong >
156
+ Density
157
157
</ h3 >
158
158
< p > The < code > mat.theme</ code > ‘s density value determines the spacing within components, such
159
159
as how much padding is used around a button’s text or the height of form fields.</ p >
@@ -181,15 +181,15 @@ <h3 id="density" class="docs-header-link">
181
181
182
182
< h2 id ="color-palettes " class ="docs-header-link ">
183
183
< span header-link ="color-palettes "> </ span >
184
- < strong > Color Palettes</ strong >
184
+ Color Palettes
185
185
</ h2 >
186
186
< p > A color palette is a set of similar colors with different hues ranging from
187
187
light to dark. The Angular Material theme uses color palettes to create a color
188
188
scheme to communicate an application’s hierarchy, state, and brand.</ p >
189
189
190
190
< h3 id ="prebuilt-color-palettes " class ="docs-header-link ">
191
191
< span header-link ="prebuilt-color-palettes "> </ span >
192
- < strong > Prebuilt Color Palettes</ strong >
192
+ Prebuilt Color Palettes
193
193
</ h3 >
194
194
< p > Angular Material provides twelve prebuilt color palettes that can be used for
195
195
your application’s theme:</ p >
@@ -210,7 +210,7 @@ <h3 id="prebuilt-color-palettes" class="docs-header-link">
210
210
211
211
< h3 id ="custom-color-palettes " class ="docs-header-link ">
212
212
< span header-link ="custom-color-palettes "> </ span >
213
- < strong > Custom Color Palettes</ strong >
213
+ Custom Color Palettes
214
214
</ h3 >
215
215
< p > The Angular Material
216
216
< a href ="https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/theme-color/README.md "> palette generation schematic</ a >
@@ -220,7 +220,7 @@ <h3 id="custom-color-palettes" class="docs-header-link">
220
220
< pre > < code > ng generate @angular/material:theme-color</ code > </ pre >
221
221
< h2 id ="loading-fonts " class ="docs-header-link ">
222
222
< span header-link ="loading-fonts "> </ span >
223
- < strong > Loading Fonts</ strong >
223
+ Loading Fonts
224
224
</ h2 >
225
225
< p > You can use Google Fonts as one option to load fonts in your application. For
226
226
example, the following code in an application’s < code > <head></ code > loads the font family
@@ -235,7 +235,7 @@ <h2 id="loading-fonts" class="docs-header-link">
235
235
236
236
< h2 id ="supporting-light-and-dark-mode " class ="docs-header-link ">
237
237
< span header-link ="supporting-light-and-dark-mode "> </ span >
238
- < strong > Supporting Light and Dark Mode</ strong >
238
+ Supporting Light and Dark Mode
239
239
</ h2 >
240
240
< p > By default, the < code > mat.theme</ code > mixin defines colors using the CSS color function
241
241
< code > light-dark</ code > to make it easy for your application to switch between light and
@@ -280,14 +280,14 @@ <h2 id="supporting-light-and-dark-mode" class="docs-header-link">
280
280
281
281
< h2 id ="multiple-themes " class ="docs-header-link ">
282
282
< span header-link ="multiple-themes "> </ span >
283
- < strong > Multiple Themes</ strong >
283
+ Multiple Themes
284
284
</ h2 >
285
285
< p > You can call the < code > mat.theme</ code > mixin more than once to apply multiple different
286
286
color schemes in your application.</ p >
287
287
288
288
< h3 id ="context-specific-themes " class ="docs-header-link ">
289
289
< span header-link ="context-specific-themes "> </ span >
290
- < strong > Context-specific Themes</ strong >
290
+ Context-specific Themes
291
291
</ h3 >
292
292
< p > The following example theme file customizes the theme for components in
293
293
different contexts. In this case, a cyan-based palette is applied to a container
@@ -310,7 +310,7 @@ <h3 id="context-specific-themes" class="docs-header-link">
310
310
}</ code > </ pre >
311
311
< h2 id ="using-theme-styles " class ="docs-header-link ">
312
312
< span header-link ="using-theme-styles "> </ span >
313
- < strong > Using Theme Styles</ strong >
313
+ Using Theme Styles
314
314
</ h2 >
315
315
< p > An application’s custom components can use the CSS variables defined by
316
316
< code > mat.theme</ code > to apply the theme’s colors and typography.</ p >
@@ -333,7 +333,7 @@ <h2 id="using-theme-styles" class="docs-header-link">
333
333
334
334
< h2 id ="customizing-tokens " class ="docs-header-link ">
335
335
< span header-link ="customizing-tokens "> </ span >
336
- < strong > Customizing Tokens</ strong >
336
+ Customizing Tokens
337
337
</ h2 >
338
338
< p > Angular Material components also allow for narrowly targeted customization of
339
339
specific tokens through the < code > overrides</ code > mixins. This enables fine-grained
@@ -345,7 +345,7 @@ <h2 id="customizing-tokens" class="docs-header-link">
345
345
346
346
< h3 id ="system-tokens " class ="docs-header-link ">
347
347
< span header-link ="system-tokens "> </ span >
348
- < strong > System Tokens</ strong >
348
+ System Tokens
349
349
</ h3 >
350
350
< p > System-level tokens can be changed to different values through the
351
351
< code > mat.theme-overrides</ code > mixin, which will redefine CSS variables that are used in
@@ -383,7 +383,7 @@ <h3 id="system-tokens" class="docs-header-link">
383
383
}</ code > </ pre >
384
384
< h3 id ="component-tokens " class ="docs-header-link ">
385
385
< span header-link ="component-tokens "> </ span >
386
- < strong > Component Tokens</ strong >
386
+ Component Tokens
387
387
</ h3 >
388
388
< p > Each Angular Material component defines an < code > overrides</ code > mixin that can be used to
389
389
customize tokenized styles for their color, typography, and density.</ p >
@@ -402,7 +402,7 @@ <h3 id="component-tokens" class="docs-header-link">
402
402
}</ code > </ pre >
403
403
< h3 id ="direct-style-overrides " class ="docs-header-link ">
404
404
< span header-link ="direct-style-overrides "> </ span >
405
- < strong > Direct Style Overrides</ strong >
405
+ Direct Style Overrides
406
406
</ h3 >
407
407
< p > Angular Material supports customizing color, typography, and density as outlined
408
408
in this document. Angular strongly discourages, and does not directly support,
@@ -413,7 +413,7 @@ <h3 id="direct-style-overrides" class="docs-header-link">
413
413
414
414
< h2 id ="shadow-dom " class ="docs-header-link ">
415
415
< span header-link ="shadow-dom "> </ span >
416
- < strong > Shadow DOM</ strong >
416
+ Shadow DOM
417
417
</ h2 >
418
418
< p > Angular Material assumes that, by default, all theme styles are loaded as global
419
419
CSS. If you want to use
0 commit comments