Skip to content

Instantly share code, notes, and snippets.

@Manyaka
Created September 1, 2020 12:52
Show Gist options
  • Save Manyaka/716cef6872ea4e369435cc47f2cbe51d to your computer and use it in GitHub Desktop.
Save Manyaka/716cef6872ea4e369435cc47f2cbe51d to your computer and use it in GitHub Desktop.
toggle-switch
input.toggle-switch( type="checkbox")
.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