Created
September 1, 2020 12:52
-
-
Save Manyaka/716cef6872ea4e369435cc47f2cbe51d to your computer and use it in GitHub Desktop.
toggle-switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.toggle-switch( type="checkbox") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.toggle-switch { | |
position: relative; | |
width: 40px; | |
height: 20px; | |
transition: all $transition; | |
border-radius: 10px; | |
outline: none; | |
background-color: $color_black10; | |
appearance: none; | |
&::before { | |
content: ''; | |
position: absolute; | |
top: 2px; | |
left: 2px; | |
width: 16px; | |
height: 16px; | |
transition: all $transition; | |
border-radius: 50%; | |
background-color: $bg_primary; | |
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); | |
} | |
&:checked { | |
background-color: $color_fruit_salad; | |
&::before { | |
left: calc(100% - 2px - 16px); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment