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