-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstylesCheckbox.css
55 lines (44 loc) · 1.28 KB
/
stylesCheckbox.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
:root {
--timeAnimationCheck: 0.5s;
--checkWidth: 36px;
}
/* div that hold the button */
.opcao {
display: flex;
align-items: center;
}
/* checkbox when no-checked */
input[type="checkbox"] {
width: calc( var(--checkWidth) );
height: calc( var(--checkWidth) / 2 );
-webkit-appearance: none;
appearance: none;
background-color: #c3c3c3;
border-radius: calc( var(--checkWidth) / 4 );
box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
outline: none;
position: relative;
transition: all var(--timeAnimationCheck); /* for color */
}
/* checkbox when checked */
input:checked[type="checkbox"] {
background-color: #b0ffb0;
}
/* ball inside the checkbox when no-checked */
input[type="checkbox"]:before {
content: "";
width: calc( var(--checkWidth) / 2 );
height: calc( var(--checkWidth) / 2 );
border-radius: calc( var(--checkWidth) / 4 );
background-color: white;
position: absolute;
top: 0;
left: 0;
transform: scale(1.1);
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
transition: all var(--timeAnimationCheck); /* for desplacement */
}
/* ball inside the checkbox when checked */
input:checked[type="checkbox"]:before {
left: calc( var(--checkWidth) / 2 );
}