Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- body {
- padding: 0 60px;
- }
- .checkbox, .radio {
- margin-bottom: 20px;
- }
- /* --- START --- */
- .checkbox *,
- .radio *{
- cursor: pointer;
- }
- .checkbox input,
- .radio input {
- opacity: 0;
- }
- .checkbox span,
- .radio span{
- position: relative;
- display: inline-block;
- margin-left: -25px;
- vertical-align: top;
- width: 30px; height: 30px;
- border-radius: 2px;
- border: 1px solid #ccc;
- border-radius: 20px;
- }
- .checkbox:hover span,
- .radio:hover span{
- border-color: teal;
- }
- .checkbox span:before,
- .radio span:before{
- position: absolute;
- top: 0; left: 0; right: 0; bottom: 0;
- opacity: 0;
- text-align: center;
- font-size: 20px;
- line-height: 27px;
- vertical-align: middle;
- color: teal;
- }
- /* override for radio */
- .radio span {
- border-radius: 50%;
- }
- .radio span:before {
- content: "";
- width: 10px; height: 10px;
- margin: 4px auto;
- background-color: teal;
- border-radius: 100px;
- }
- .checkbox input[type=checkbox]:checked + span,
- .radio input[type=radio]:checked + span{
- border-color: teal;
- background-color: teal;
- }
- .radio input[type=radio]:checked + span{
- background-color: #fff;
- }
- .checkbox input[type=checkbox]:checked + span:before,
- .radio input[type=radio]:checked + span:before{
- color: #fff;
- opacity: 1;
- transition: color .3 ease-out;
- }
- .checkbox input[type=checkbox]:disabled + span,
- .radio input[type=radio]:disabled + span{
- border-color: #ddd !important;
- background-color: #ddd !important;
- }
- /* --- SWITCH --- */
- .switch * {
- cursor: pointer;
- }
- .switch input {
- opacity: 0;
- position: absolute;
- z-index: -1;
- }
- .switch span {
- position: relative;
- display: inline-block;
- width: 58px; height: 30px;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 100px;
- transition: all .5s;
- box-shadow: 1px 2px 3px rgba(0,0,0,0.1) inset;
- }
- .switch span:after {
- content: "";
- position: absolute;
- background-color: #fff;
- top: 0; left: 0;
- height: 28px; width: 28px;
- border: 1px solid #ddd;
- border-radius: 400px;
- box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
- -webkit-transition: all .2s;
- }
- .switch input:checked + span {
- background-color: teal;
- border-color: teal;
- transition: all .5s;
- }
- .switch input:checked + span:after {
- left: 50%;
- transition: all .2s;
- }
Advertisement
Add Comment
Please, Sign In to add comment