@@ -411,6 +411,69 @@ <h3 id="direct-style-overrides" class="docs-header-link">
411411change at any time. CSS variables used by the Angular Material components should
412412be defined through the < code > overrides</ code > API instead of defined explicitly.</ p >
413413
414+ < h2 id ="strong-focus-indicators " class ="docs-header-link ">
415+ < span header-link ="strong-focus-indicators "> </ span >
416+ Strong focus indicators
417+ </ h2 >
418+ < p > By default, most components indicate browser focus by changing their background color as described
419+ by the Material Design specification. This behavior, however, can fall short of accessibility
420+ requirements, such as [WCAG 4.5:1][], which require a stronger indication of browser focus.</ p >
421+ < p > Angular Material supports rendering highly visible outlines on focused elements. Applications can
422+ enable these strong focus indicators via two Sass mixins:
423+ < code > strong-focus-indicators</ code > and < code > strong-focus-indicators-theme</ code > .</ p >
424+ < p > The < code > strong-focus-indicators</ code > mixin emits structural indicator styles for all components. This mixin
425+ should be included exactly once in an application, similar to the < code > core</ code > mixin described above.</ p >
426+ < p > The < code > strong-focus-indicators-theme</ code > mixin emits only the indicator's color styles. This mixin should
427+ be included once per theme, similar to the theme mixins described above. Additionally, you can use
428+ this mixin to change the color of the focus indicators in situations in which the default color
429+ would not contrast sufficiently with the background color.</ p >
430+ < p > The following example includes strong focus indicator styles in an application alongside the rest of
431+ the custom theme API.</ p >
432+ < pre > < code class ="language-scss "> < span class ="hljs-keyword "> @use</ span > < span class ="hljs-string "> '@angular/material'</ span > as mat;
433+
434+ < span class ="hljs-variable "> $my-theme</ span > : (
435+ color: mat.< span class ="hljs-variable "> $violet-palette</ span > ,
436+ typography: Roboto,
437+ density: < span class ="hljs-number "> 0</ span >
438+ );
439+
440+ < span class ="hljs-keyword "> @include</ span > mat.strong-focus-indicators();
441+
442+ < span class ="hljs-selector-tag "> html</ span > {
443+ < span class ="hljs-attribute "> color-scheme</ span > : light dark;
444+ < span class ="hljs-keyword "> @include</ span > mat.theme(< span class ="hljs-variable "> $my-theme</ span > );
445+ < span class ="hljs-keyword "> @include</ span > mat.strong-focus-indicators-theme(< span class ="hljs-variable "> $my-theme</ span > );
446+ }</ code > </ pre >
447+ < h3 id ="customizing-strong-focus-indicators " class ="docs-header-link ">
448+ < span header-link ="customizing-strong-focus-indicators "> </ span >
449+ Customizing strong focus indicators
450+ </ h3 >
451+ < p > You can pass a configuration map to < code > strong-focus-indicators</ code > to customize the appearance of the
452+ indicators. This configuration includes < code > border-style</ code > , < code > border-width</ code > , and < code > border-radius</ code > .</ p >
453+ < p > You also can customize the color of indicators with < code > strong-focus-indicators-theme</ code > . This mixin
454+ accepts either a theme, as described earlier in this guide, or a CSS color value. When providing a
455+ theme, the indicators will use the default hue of the primary palette.</ p >
456+ < p > The following example includes strong focus indicator styles with custom settings alongside the rest
457+ of the custom theme API.</ p >
458+ < pre > < code class ="language-scss "> < span class ="hljs-keyword "> @use</ span > < span class ="hljs-string "> '@angular/material'</ span > as mat;
459+
460+ < span class ="hljs-keyword "> @include</ span > mat.strong-focus-indicators((
461+ < span class ="hljs-attribute "> border-style</ span > : dotted,
462+ < span class ="hljs-attribute "> border-width</ span > : < span class ="hljs-number "> 4px</ span > ,
463+ < span class ="hljs-attribute "> border-radius</ span > : < span class ="hljs-number "> 2px</ span > ,
464+ ));
465+
466+ < span class ="hljs-selector-tag "> html</ span > {
467+ < span class ="hljs-attribute "> color-scheme</ span > : light dark;
468+
469+ < span class ="hljs-keyword "> @include</ span > mat.theme((
470+ < span class ="hljs-attribute "> color</ span > : mat.< span class ="hljs-variable "> $rose-palette</ span > ,
471+ < span class ="hljs-attribute "> typography</ span > : Roboto,
472+ < span class ="hljs-attribute "> density</ span > : < span class ="hljs-number "> 0</ span >
473+ ));
474+
475+ < span class ="hljs-keyword "> @include</ span > mat.strong-focus-indicators-theme(orange);
476+ }</ code > </ pre >
414477 < h2 id ="shadow-dom " class ="docs-header-link ">
415478 < span header-link ="shadow-dom "> </ span >
416479 Shadow DOM
0 commit comments