Resize toggle switches with font

pull/21833/head
Jorik Schellekens 2020-04-07 14:21:21 +01:00
parent cef6868f02
commit f59bd538b4
1 changed files with 17 additions and 17 deletions

View File

@ -16,12 +16,19 @@ limitations under the License.
.mx_ToggleSwitch {
transition: background-color 0.20s ease-out 0.1s;
width: 48px;
height: 24px;
border-radius: 14px;
width: $font-48px;
height: $font-20px;
border-radius: 1.5rem;
padding: 2px;
background-color: $togglesw-off-color;
position: relative;
opacity: 0.5;
display: flex;
flex-direction: row;
flex: 0 0 auto;
align-items: center;
}
.mx_ToggleSwitch_enabled {
@ -35,19 +42,12 @@ limitations under the License.
.mx_ToggleSwitch_ball {
transition: left 0.15s ease-out 0.1s;
margin: 2px;
width: 20px;
height: 20px;
border-radius: 20px;
width: $font-20px;
height: $font-20px;
border-radius: $font-20px;
background-color: $togglesw-ball-color;
position: absolute;
top: 0;
}
.mx_ToggleSwitch_on > .mx_ToggleSwitch_ball {
left: 23px; // 48px switch - 20px ball - 5px padding = 23px
}
.mx_ToggleSwitch:not(.mx_ToggleSwitch_on) > .mx_ToggleSwitch_ball {
left: 2px;
.mx_ToggleSwitch_on {
flex-direction: row-reverse;
}