2020-03-27 11:37:54 +00:00
|
|
|
/* Thanks to Guus Lieben for the Material Design Switch */
|
|
|
|
|
2020-09-07 00:16:25 +00:00
|
|
|
.switch-ctn
|
2020-09-07 01:19:08 +00:00
|
|
|
margin: 20px 16px
|
2020-09-07 00:16:25 +00:00
|
|
|
position: relative
|
|
|
|
|
2020-09-07 01:19:08 +00:00
|
|
|
&.compact
|
|
|
|
margin: 0
|
|
|
|
|
2020-03-27 11:37:54 +00:00
|
|
|
.switch-input
|
2020-09-07 02:18:03 +00:00
|
|
|
-moz-appearance: none
|
|
|
|
-webkit-appearance: none
|
2020-09-07 00:16:25 +00:00
|
|
|
appearance: none
|
|
|
|
height: 20px
|
2020-09-07 01:19:08 +00:00
|
|
|
left: -3px
|
2020-09-07 00:16:25 +00:00
|
|
|
position: absolute
|
|
|
|
top: calc(50% - 3px)
|
|
|
|
-ms-transform: translate(0, (-50%))
|
|
|
|
-webkit-transform: translate(0, -50%)
|
|
|
|
transform: translate(0, -50%)
|
|
|
|
width: 34px
|
2020-03-27 11:37:54 +00:00
|
|
|
|
|
|
|
.switch-label
|
2020-09-07 00:55:17 +00:00
|
|
|
position: relative
|
2020-03-27 11:37:54 +00:00
|
|
|
display: inline-block
|
|
|
|
cursor: pointer
|
|
|
|
font-weight: 500
|
|
|
|
text-align: left
|
2020-09-07 01:19:08 +00:00
|
|
|
padding: 12px 0 12px 44px
|
2020-03-27 11:37:54 +00:00
|
|
|
|
2020-04-12 03:18:38 +00:00
|
|
|
&:before, &:after
|
|
|
|
content: ""
|
|
|
|
position: absolute
|
|
|
|
margin: 0
|
|
|
|
outline: 0
|
|
|
|
top: 50%
|
|
|
|
-ms-transform: translate(0, -50%)
|
|
|
|
-webkit-transform: translate(0, -50%)
|
|
|
|
transform: translate(0, -50%)
|
|
|
|
-webkit-transition: all 0.3s ease
|
|
|
|
transition: all 0.3s ease
|
|
|
|
|
|
|
|
&:before
|
|
|
|
left: 1px
|
|
|
|
width: 34px
|
|
|
|
height: 14px
|
|
|
|
background-color: #9E9E9E
|
|
|
|
border-radius: 8px
|
|
|
|
|
|
|
|
.switch-input:checked + &
|
|
|
|
background-color: var(--accent-color-light)
|
|
|
|
|
2020-10-06 13:38:35 +00:00
|
|
|
.switch-input:disabled + &
|
|
|
|
background-color: #9E9E9E
|
|
|
|
|
2020-04-12 03:18:38 +00:00
|
|
|
&:after
|
|
|
|
left: 0
|
|
|
|
width: 20px
|
|
|
|
height: 20px
|
|
|
|
background-color: #FAFAFA
|
|
|
|
border-radius: 50%
|
|
|
|
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 2px 2px 0 rgba(0, 0, 0, 0.098), 0 1px 5px 0 rgba(0, 0, 0, 0.084)
|
|
|
|
|
|
|
|
.switch-input:checked + &
|
|
|
|
background-color: var(--accent-color)
|
|
|
|
-ms-transform: translate(80%, -50%)
|
|
|
|
-webkit-transform: translate(80%, -50%)
|
|
|
|
transform: translate(80%, -50%)
|
2020-10-06 13:38:35 +00:00
|
|
|
|
|
|
|
.switch-input:disabled + &
|
|
|
|
background-color: #BDBDBD
|