@@ -117,33 +117,36 @@ $legacy-border-radius: 2px !default;
117
117
118
118
// Overlay to be used as a tint.
119
119
.mat-button-toggle-focus-overlay {
120
+ @include layout-common .fill ;
120
121
border-radius : inherit ;
121
122
122
123
// Disable pointer events to prevent it from hijacking user events.
123
124
pointer-events : none ;
124
125
opacity : 0 ;
125
- @include layout-common . fill ;
126
+ }
126
127
128
+ @include cdk .high-contrast (active , off) {
127
129
// Changing the background color for the selected item won't be visible in high contrast mode.
128
130
// We fall back to using the overlay to draw a brighter, semi-transparent tint on top instead.
129
131
// It uses a border, because the browser will render it using a brighter color.
130
- @include cdk . high-contrast ( active , off) {
131
- .mat-button-toggle-checked & {
132
+ .mat-button-toggle-checked {
133
+ .mat-button-toggle-focus-overlay {
132
134
border-bottom : solid $legacy-height ;
133
135
opacity : 0.5 ;
134
136
height : 0 ;
135
137
}
136
- }
137
- }
138
138
139
- @include cdk .high-contrast (active , off) {
140
- .mat-button-toggle-checked.mat-button-toggle-appearance-standard
141
- .mat-button-toggle-focus-overlay {
142
- // In high contrast mode, we use a border for the checked state because backgrounds
143
- // can either be opaque or transparent. We set the border height to a value that is larger
144
- // than usual button toggles are. This allows us to keep this high contrast style in the
145
- // base component style, instead of making it dependent on height determined through density.
146
- border-bottom : solid 500px ;
139
+ & :hover .mat-button-toggle-focus-overlay {
140
+ opacity : 0.6 ;
141
+ }
142
+
143
+ & .mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay {
144
+ // In high contrast mode, we use a border for the checked state because backgrounds
145
+ // can either be opaque or transparent. We set the border height to a value that is larger
146
+ // than usual button toggles are. This allows us to keep this high contrast style in the
147
+ // base component style, instead of making it dependent on height determined through density.
148
+ border-bottom : solid 500px ;
149
+ }
147
150
}
148
151
}
149
152
0 commit comments