fix(list): disable hover styling on touch devices (#12520)

This commit is contained in:
Kristiyan Kostadinov
2018-08-07 22:35:22 +02:00
committed by Joey Perrott
parent 7dff5f8eb6
commit 795c95615f
+17 -2
View File
@@ -209,6 +209,7 @@ $mat-list-item-inset-divider-offset: 72px;
.mat-list, .mat-nav-list, .mat-selection-list {
padding-top: $mat-list-top-padding;
display: block;
-webkit-tap-highlight-color: transparent;
.mat-subheader {
@include mat-subheader-spacing($mat-list-top-padding, $mat-list-base-height);
@@ -228,8 +229,9 @@ $mat-list-item-inset-divider-offset: 72px;
}
.mat-list[dense], .mat-nav-list[dense], .mat-selection-list[dense] {
.mat-list[dense],
.mat-nav-list[dense],
.mat-selection-list[dense] {
padding-top: $mat-dense-top-padding;
display: block;
@@ -266,3 +268,16 @@ $mat-list-item-inset-divider-offset: 72px;
cursor: pointer;
outline: none;
}
// Disable the hover styles on non-hover devices. Since this is more of a progressive
// enhancement and not all desktop browsers support this kind of media query, we can't
// use something like `@media (hover)`.
@media (hover: none) {
.mat-list-option,
.mat-nav-list .mat-list-item {
&:hover {
background: none;
}
}
}