-
Notifications
You must be signed in to change notification settings - Fork 3
/
labels.css
90 lines (78 loc) · 1.93 KB
/
labels.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* This file is from a codepen by user @andreasstorm: https://codepen.io/andreasstorm/pen/dNqLBz - modified by blueYOSHI
*/
.inputContainer {
height: 15px;
}
input[type="checkbox"], input[type="radio"] {
display: initial; /* not display: none; so scrollIntoView() can be used */
position: absolute;
visibility: hidden;
}
label.newdesign {
display: inline-block;
position: relative;
top: -1px;
width: 15px;
height: 15px;
border: 1px solid #c8ccd4;
border-radius: 3px;
background-color: #6871f123;
vertical-align: middle;
transition: background 0.1s ease;
cursor: pointer;
-webkit-transition: background-color .3s;
-moz-transition: background-color .3s;
transition: background-color .3s;
}
label.newdesign:hover, label:hover label.newdesign, label:hover ~ span > label.newdesign {
background-color: #6871f14a;
}
label.newdesign:after {
content: '';
position: absolute;
opacity: 0;
transform: rotate(45deg) scale(0);
transition: all 0.3s ease;
transition-delay: 0.03s;
}
input[type="checkbox"] ~ label.newdesign:after {
top: 0px;
left: 5px;
width: 4px;
height: 10px;
border-right: 2px solid #fff;
border-bottom: 2px solid #fff;
}
input[type="radio"] ~ label.newdesign:after {
top: 2px;
left: 2px;
height: 6px;
width: 6px;
border: 2px solid #fff;
border-radius: 30px;
background-color: #fff;
}
input[type="radio"] ~ label.newdesign {
border-radius: 30px;
}
input[type="checkbox"]:checked ~ label.newdesign, input[type="radio"]:checked ~ label.newdesign {
border-color: transparent;
background: #6871f1;
animation: jelly 0.6s ease;
}
input[type="checkbox"]:checked ~ label.newdesign:after, input[type="radio"]:checked ~ label.newdesign:after {
opacity: 1;
transform: rotate(45deg) scale(1);
}
input[type="checkbox"][disabled] ~ label.newdesign, input[type="radio"][disabled] ~ label.newdesign {
cursor: default !important;
}
@keyframes jelly {
from {
transform: scale(1, 1);
}
to {
transform: scale(1, 1);
}
}