Skip to content

Commit

Permalink
fix(material/list): remove unnecessary high contrast styles
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto committed Sep 10, 2024
1 parent ef14c28 commit 9dcb95a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/material/list/_list-inherited-structure.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@use '@angular/cdk';
@use '../core/style/vendor-prefixes';
@use '../core/tokens/m2/mdc/list' as tokens-mdc-list;
@use '../core/tokens/token-utils';
Expand Down Expand Up @@ -93,31 +92,6 @@
margin-top: 16px;
}
}

&.mdc-list-item--selected::before,
&.mdc-list-item--selected:focus::before,
&:not(.mdc-list-item--selected):focus::before {
position: absolute;
box-sizing: border-box;
width: 100%;
height: 100%;
top: 0;
left: 0;
border: 1px solid transparent;
border-radius: inherit;
content: '';
pointer-events: none;

@include cdk.high-contrast {
border-color: CanvasText;
}
}

&.mdc-list-item--selected:focus::before,
&.mdc-list-item--selected::before {
border-width: 3px;
border-style: double;
}
}

a.mdc-list-item {
Expand Down
3 changes: 3 additions & 0 deletions src/material/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ a.mdc-list-item--activated {
content: '';
opacity: 0;
pointer-events: none;

// This comes up in some internal implementations.
border-radius: inherit;
}

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

0 comments on commit 9dcb95a

Please sign in to comment.