File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/material-experimental/mdc-list Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 11@use ' @material/list' as mdc-list ;
22@use ' ../mdc-helpers/mdc-helpers' ;
33@use ' ../../material/core/style/layout-common' ;
4+ @use ' ../../cdk/a11y/a11y' ;
45
56@include mdc-list .deprecated-without-ripple ($query : mdc-helpers .$mat-base-styles-query );
67
124125 @include layout-common .fill ();
125126 pointer-events : none ;
126127}
128+
129+
130+ @include a11y .high-contrast (active , off) {
131+ .mat-mdc-list-option ,
132+ .mat-mdc-nav-list .mat-mdc-list-item ,
133+ .mat-mdc-action-list .mat-mdc-list-item {
134+ & :hover , & :focus {
135+ outline : dotted 1px ;
136+ }
137+ }
138+
139+ // In single selection mode, the selected option is indicated by changing its
140+ // background color, but that doesn't work in high contrast mode. We add an
141+ // alternate indication by rendering out a circle.
142+ .mat-mdc-list-option.mdc-list-item--selected ::after {
143+ $size : 10px ;
144+ content : ' ' ;
145+ position : absolute ;
146+ top : 50% ;
147+ right : mdc-list .$deprecated-side-padding ;
148+ transform : translateY (-50% );
149+ width : $size ;
150+ height : 0 ;
151+ border-bottom : solid $size ;
152+ border-radius : $size ;
153+ }
154+
155+ [dir = ' rtl' ] .mat-mdc-list-option.mdc-list-item--selected ::after {
156+ right : auto ;
157+ left : mdc-list .$deprecated-side-padding ;
158+ }
159+ }
You can’t perform that action at this time.
0 commit comments