Skip to content

Instantly share code, notes, and snippets.

@SaulBurgos
Created July 21, 2022 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaulBurgos/435d444512d1b6a5d977f125b5b6fcb1 to your computer and use it in GitHub Desktop.
Save SaulBurgos/435d444512d1b6a5d977f125b5b6fcb1 to your computer and use it in GitHub Desktop.
<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