Created
July 21, 2022 22:32
-
-
Save SaulBurgos/435d444512d1b6a5d977f125b5b6fcb1 to your computer and use it in GitHub Desktop.
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
<style> | |
/* Toggle Button */ | |
.cm-toggle input { | |
-webkit-appearance: none; | |
-webkit-tap-highlight-color: transparent; | |
position: relative; | |
border: 0; | |
outline: 0; | |
cursor: pointer; | |
margin: 10px; | |
} | |
/* To create surface of toggle button */ | |
.cm-toggle input:after { | |
content: ''; | |
width: 60px; | |
height: 28px; | |
display: inline-block; | |
background: rgba(196, 195, 195, 0.55); | |
border-radius: 18px; | |
clear: both; | |
} | |
/* Contents before checkbox to create toggle handle */ | |
.cm-toggle input:before { | |
content: ''; | |
width: 32px; | |
height: 32px; | |
display: block; | |
position: absolute; | |
left: 0; | |
top: -3px; | |
border-radius: 50%; | |
background: rgb(255, 255, 255); | |
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); | |
} | |
/* Shift the handle to left on check event */ | |
.cm-toggle input:checked:before { | |
left: 32px; | |
box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.6); | |
} | |
/* Background color when toggle button will be active */ | |
.cm-toggle input:checked:after { | |
background: #16a085; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment