-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_checkboxes.scss
More file actions
120 lines (111 loc) · 2.56 KB
/
_checkboxes.scss
File metadata and controls
120 lines (111 loc) · 2.56 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.checkbox {
&, & > label {
display: inline-flex;
align-items: center;
}
& > label {
padding-left: 0;
}
label {
&:hover {
cursor: pointer;
}
}
}
.nowrap.checkbox{
white-space: nowrap;
}
.checkbox {
margin: 0.3125rem 0;
padding: 0;
}
.checkbox > [type="checkbox"],
label{
margin-bottom: 0 !important;
user-select: none;
}
.checkbox > [type="checkbox"] {
position: absolute;
left: -624.9375rem;
}
.checkbox > [type="checkbox"] {
&:checked + label svg {
opacity: 1;
transition: none;
}
&:not(:checked) + label svg {
opacity: 0;
transition: .2s ease opacity;
}
&:checked + label path {
stroke-dashoffset: 0;
transition: stroke-dashoffset .35s cubic-bezier(1,.255,.395,.84);
}
& + label path {
stroke-dasharray: 3rem;
stroke-dashoffset: 3rem;
transition: stroke-dashoffset 0s .3s;
}
&:checked + label .checkbox-box {
background: $primary;
border-color: mix(white, $primary, 30%);
}
& + label .checkbox-text {
padding-left: 0.375rem;
}
&:disabled + label {
cursor: not-allowed;
& .checkbox-box {
opacity: .3;
cursor: not-allowed; // need to have this here also because 'cursor: pointer;' is manually set for this element
}
& .checkbox-text {
opacity: .6;
}
}
&:not(:checked) + label:hover .checkbox-box {
border: 0.0625rem solid $primary;
}
&:focus {
& + label .checkbox-box {
border: 0.0625rem solid #007fff;
box-shadow: inset 0 0.0625rem 0.0625rem rgba(0, 0, 0, 0.13), 0 0 0.5rem rgb(102, 175, 233);
}
}
&:not(:checked) {
&:focus, &:hover {
& + .checkbox-box {
background: mix(white, $primary, 97%);
}
}
}
}
.checkbox > [type="checkbox"] + label .checkbox-box {
border: 0.0625rem solid gray;
background: #ffffff;
border-radius: $border-radius-small;
cursor: pointer;
display: inline-block;
min-width: 1.25rem;
max-width: 1.25rem;
min-height: 1.25rem;
max-height: 1.25rem;
padding-left: 0;
position: relative;
transition: border-color .3s;
// z-index: 1;
transition: .2s ease background;
}
// inline checkboxes
.form-inline .checkbox {
display: inline-flex;
height: 2.125rem;
align-items: center;
}
.checkbox svg {
height: 0.8125rem;
width: 0.8125rem;
top: 0.125rem;
left: 0.125rem;
position: absolute;
}