Skip to content

Commit 9dcb95a

Browse files
committed
fix(material/list): remove unnecessary high contrast styles
Removes some styles from the list meant for high contrast mode that we inherited from MDC. They aren't necessary, because we have our own way of handling high contrast styles and they were actively making `mat-option` worse by adding extra borders in several cases.
1 parent ef14c28 commit 9dcb95a

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

src/material/list/_list-inherited-structure.scss

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use '@angular/cdk';
21
@use '../core/style/vendor-prefixes';
32
@use '../core/tokens/m2/mdc/list' as tokens-mdc-list;
43
@use '../core/tokens/token-utils';
@@ -93,31 +92,6 @@
9392
margin-top: 16px;
9493
}
9594
}
96-
97-
&.mdc-list-item--selected::before,
98-
&.mdc-list-item--selected:focus::before,
99-
&:not(.mdc-list-item--selected):focus::before {
100-
position: absolute;
101-
box-sizing: border-box;
102-
width: 100%;
103-
height: 100%;
104-
top: 0;
105-
left: 0;
106-
border: 1px solid transparent;
107-
border-radius: inherit;
108-
content: '';
109-
pointer-events: none;
110-
111-
@include cdk.high-contrast {
112-
border-color: CanvasText;
113-
}
114-
}
115-
116-
&.mdc-list-item--selected:focus::before,
117-
&.mdc-list-item--selected::before {
118-
border-width: 3px;
119-
border-style: double;
120-
}
12195
}
12296

12397
a.mdc-list-item {

src/material/list/list.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ a.mdc-list-item--activated {
116116
content: '';
117117
opacity: 0;
118118
pointer-events: none;
119+
120+
// This comes up in some internal implementations.
121+
border-radius: inherit;
119122
}
120123

121124
// The MDC-based list items already use the `::before` pseudo element for the standard

0 commit comments

Comments
 (0)