Skip to content

Commit 69753d7

Browse files
crisbetowagnermaciel
authored andcommitted
fix(material/core): disable strong focus indicators in high contrast mode (#24120)
Most components have special handling for high contrast mode which can cause double focus indication when strong focus indication is disabled. These changes remove the strong focus indicators if such a case is detected. Fixes #24097. (cherry picked from commit 040ef57)
1 parent e8b400f commit 69753d7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/material-experimental/mdc-helpers/_focus-indicators.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
pointer-events: none;
2929
border: $border-width $border-style transparent;
3030
border-radius: $border-radius;
31+
32+
.cdk-high-contrast-active & {
33+
display: none;
34+
}
3135
}
3236

3337
// By default, all focus indicators are flush with the bounding box of their

src/material/core/focus-indicators/_focus-indicators.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
pointer-events: none;
2929
border: $border-width $border-style transparent;
3030
border-radius: $border-radius;
31+
32+
.cdk-high-contrast-active & {
33+
display: none;
34+
}
3135
}
3236

3337
// By default, all focus indicators are flush with the bounding box of their

0 commit comments

Comments
 (0)