-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material/list): visually indicate active links in HCM (#25679)
For anchor tags inside of a list, draw a circle in HCM mode to indicate the active link item. This fixes an a11y issue where active list-items had no visual indication of being active in HCM.
- Loading branch information
Showing
5 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@use '@angular/cdk'; | ||
@use '@material/list/evolution-variables' as mdc-list-variables; | ||
|
||
// Renders a circle indicator when Windows Hich Constrast mode (HCM) is enabled. In some | ||
// situations, such as a selected option, the list item communicates the selected state by changing | ||
// its background color. Since that doesn't work in HCM, this mixin provides an alternative by | ||
// rendering a circle. | ||
@mixin private-high-contrast-list-item-indicator() { | ||
@include cdk.high-contrast(active, off) { | ||
&::after { | ||
$size: 10px; | ||
content: ''; | ||
position: absolute; | ||
top: 50%; | ||
right: mdc-list-variables.$side-padding; | ||
transform: translateY(-50%); | ||
width: $size; | ||
height: 0; | ||
border-bottom: solid $size; | ||
border-radius: $size; | ||
} | ||
|
||
[dir='rtl'] { | ||
&::after { | ||
right: auto; | ||
left: mdc-list-variables.$side-padding; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters