Skip to content

Instantly share code, notes, and snippets.

@Hansanghyeon
Created December 30, 2020 08:52
Show Gist options
  • Save Hansanghyeon/a6eb12e8201d2ab27c2a9afda9f80931 to your computer and use it in GitHub Desktop.
Save Hansanghyeon/a6eb12e8201d2ab27c2a9afda9f80931 to your computer and use it in GitHub Desktop.
[ui] ios checkbox
label.iosCheckbox {
display: inline-block;
background: #fff;
padding: 10px 15px;
> input {
display: none;
}
i {
display: inline-block;
padding: 2px;
width: 40px;
height: 20px;
border-radius: 13px;
vertical-align: middle;
transition: 0.25s 0.09s;
position: relative;
background: #aaaaaa;
box-sizing: initial;
&:after {
content: " ";
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
background: #fff;
position: absolute;
left: 2px;
transition: 0.25s;
}
}
> input:checked + i {
background: #47c17a;
}
> input:checked + i:after {
transform: translateX(20px);
}
&:hover {
cursor: pointer;
}
}
<label class="iosCheckbox>
Bluetooth
<input type="checkbox" />
<i></i>
</label>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment