Skip to content

Commit 3c71348

Browse files
crisbetommalerba
authored andcommittedJan 4, 2019
fix(list): add hover and focus indication in high contrast mode (#14637)
Fixes not being able to see which lists/list items are focused or hovered in high contrast mode.
1 parent 9e3a77b commit 3c71348

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
 

‎src/lib/list/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ sass_binary(
3333
name = "list_scss",
3434
src = "list.scss",
3535
deps = [
36+
"//src/cdk/a11y:a11y_scss_lib",
3637
"//src/lib/core:core_scss_lib",
3738
"//src/lib/divider:divider_scss_lib"
3839
],

‎src/lib/list/list.scss

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '../core/style/list-common';
33
@import '../core/style/layout-common';
44
@import '../divider/divider-offset';
5+
@import '../../cdk/a11y/a11y';
56

67

78
$mat-list-side-padding: 16px;
@@ -269,7 +270,7 @@ $mat-list-item-inset-divider-offset: 72px;
269270
}
270271

271272
mat-action-list {
272-
//remove the native button look and make it look like a list item
273+
// Remove the native button look and make it look like a list item
273274
button {
274275
background: none;
275276
color: inherit;
@@ -289,6 +290,20 @@ mat-action-list {
289290
outline: none;
290291
}
291292

293+
@include cdk-high-contrast {
294+
.mat-selection-list:focus {
295+
outline-style: dotted;
296+
}
297+
298+
.mat-list-option,
299+
.mat-nav-list .mat-list-item,
300+
mat-action-list .mat-list-item {
301+
&:hover, &:focus {
302+
outline: dotted 1px;
303+
}
304+
}
305+
}
306+
292307

293308
// Disable the hover styles on non-hover devices. Since this is more of a progressive
294309
// enhancement and not all desktop browsers support this kind of media query, we can't

0 commit comments

Comments
 (0)
Please sign in to comment.