5858}
5959```
6060
61- You can also define a convenient set of CSS utility classes that let you apply
61+ You can also define a convenient set of CSS utility classes that let you apply
6262theme styles from your component templates.
6363
6464``` scss
@@ -103,10 +103,10 @@ distinct accent color to some components.
103103
104104You can also set the ` theme-type ` to determine the color values are defined:
105105
106- * ` color-scheme ` \- include both light and dark colors using the ` light-dark `
107- CSS color function
108- * ` light ` \- only define the light color values
109- * ` dark ` \- only define the dark color values
106+ - ` color-scheme ` \- include both light and dark colors using the ` light-dark `
107+ CSS color function
108+ - ` light ` \- only define the light color values
109+ - ` dark ` \- only define the dark color values
110110
111111The ` light-dark ` CSS color function is
112112[ widely available] ( https://caniuse.com/?search=light-dark ) for all major
@@ -227,18 +227,18 @@ scheme to communicate an application’s hierarchy, state, and brand.
227227Angular Material provides twelve prebuilt color palettes that can be used for
228228your application’s theme:
229229
230- * ` $red-palette `
231- * ` $green-palette `
232- * ` $blue-palette `
233- * ` $yellow-palette `
234- * ` $cyan-palette `
235- * ` $magenta-palette `
236- * ` $orange-palette `
237- * ` $chartreuse-palette `
238- * ` $spring-green-palette `
239- * ` $azure-palette `
240- * ` $violet-palette `
241- * ` $rose-palette `
230+ - ` $red-palette `
231+ - ` $green-palette `
232+ - ` $blue-palette `
233+ - ` $yellow-palette `
234+ - ` $cyan-palette `
235+ - ` $magenta-palette `
236+ - ` $orange-palette `
237+ - ` $chartreuse-palette `
238+ - ` $spring-green-palette `
239+ - ` $azure-palette `
240+ - ` $violet-palette `
241+ - ` $rose-palette `
242242
243243### Custom Color Palettes
244244
@@ -485,46 +485,32 @@ by the Material Design specification. This behavior, however, can fall short of
485485requirements, such as [ WCAG 4.5:1] [ ] , which require a stronger indication of browser focus.
486486
487487Angular Material supports rendering highly visible outlines on focused elements. Applications can
488- enable these strong focus indicators via two Sass mixins:
489- ` strong-focus-indicators ` and ` strong-focus-indicators-theme ` .
490-
491- The ` strong-focus-indicators ` mixin emits structural indicator styles for all components. This mixin
492- should be included exactly once in an application, similar to the ` core ` mixin described above.
493-
494- The ` strong-focus-indicators-theme ` mixin emits only the indicator's color styles. This mixin should
495- be included once per theme, similar to the theme mixins described above. Additionally, you can use
496- this mixin to change the color of the focus indicators in situations in which the default color
497- would not contrast sufficiently with the background color.
498-
499- The following example includes strong focus indicator styles in an application alongside the rest of
500- the custom theme API.
488+ enable these strong focus indicators by calling ` mat.strong-focus-indicators() ` .
501489
502490``` scss
503491@use ' @angular/material' as mat ;
504492
505- $my-theme : (
506- color : mat .$violet-palette ,
507- typography : Roboto,
508- density : 0
509- );
510-
511- @include mat .strong-focus-indicators ();
512-
513493html {
514494 color-scheme : light dark ;
515- @include mat .theme ($my-theme );
516- @include mat .strong-focus-indicators-theme ($my-theme );
495+ @include mat .theme ((
496+ color : mat .$violet-palette ,
497+ typography: Roboto,
498+ density: 0
499+ ));
500+ @include mat .strong-focus-indicators ();
517501}
518502```
519503
504+ By default, the focus indicator uses the theme's secondary color, but you can customize this color
505+ by calling the ` strong-focus-indicators-theme($color) ` mixin. Additionally, you can use
506+ this mixin to change the color of the focus indicators in situations in which the default color
507+ would not contrast sufficiently with the background color.
508+
520509### Customizing strong focus indicators
521510
522511You can pass a configuration map to ` strong-focus-indicators ` to customize the appearance of the
523- indicators. This configuration includes ` border-style ` , ` border-width ` , and ` border-radius ` .
524-
525- You also can customize the color of indicators with ` strong-focus-indicators-theme ` . This mixin
526- accepts either a theme, as described earlier in this guide, or a CSS color value. When providing a
527- theme, the indicators will use the default hue of the primary palette.
512+ indicators. This configuration includes ` border-color ` , ` border-style ` , ` border-width ` , and
513+ ` border-radius ` .
528514
529515The following example includes strong focus indicator styles with custom settings alongside the rest
530516of the custom theme API.
@@ -533,22 +519,11 @@ of the custom theme API.
533519@use ' @angular/material' as mat ;
534520
535521@include mat .strong-focus-indicators ((
522+ border-color : red ,
536523 border-style : dotted ,
537524 border-width : 4px ,
538525 border-radius : 2px ,
539526));
540-
541- html {
542- color-scheme : light dark ;
543-
544- @include mat .theme ((
545- color : mat .$rose-palette ,
546- typography: Roboto,
547- density: 0
548- ));
549-
550- @include mat .strong-focus-indicators-theme (orange );
551- }
552527```
553528
554529[ WCAG ] : https://www.w3.org/WAI/standards-guidelines/wcag/glance/
0 commit comments