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