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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
.form-group {
}
.checkbox {
label {
cursor: pointer;
padding-left: 0; // Reset for Bootstrap rule
color: $mdb-checkbox-label-color;
@include mdb-label-color-toggle-focus();
}
// Hide native checkbox
input[type=checkbox] {
opacity: 0;
position: absolute;
margin: 0;
z-index: -1;
width: 0;
height: 0;
overflow: hidden;
left: 0;
pointer-events: none;
}
.checkbox-material {
vertical-align: middle;
position: relative;
top: 1px;
padding-right: 5px;
display: inline-block;
&:before {
display: block;
position: absolute;
left: 0;
content: "";
background-color: rgba(0,0,0,.84);
height: $mdb-checkbox-size;
width: $mdb-checkbox-size;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
top: 0;
@include transform-scale3d(unquote('2.3,2.3,1'));
}
.check {
position: relative;
display: inline-block;
width: $mdb-checkbox-size;
height: $mdb-checkbox-size;
border: 1px solid $mdb-checkbox-border-color;
overflow: hidden;
z-index: 1;
border-radius: $border-radius-base;
}
.check:before {
position: absolute;
content: "";
transform: rotate(45deg);
display: block;
margin-top: -3px;
margin-left: 7px;
width: 0;
height: 0;
background: red;
box-shadow:
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0 inset;
@include animation(checkbox-off $mdb-checkbox-animation-check forwards);
}
}
input[type=checkbox] {
&:focus + .checkbox-material .check:after {
opacity: 0.2;
}
&:checked {
& + .checkbox-material .check {
background: $mdb-checkbox-checked-color;
}
& + .checkbox-material .check:before {
color: #FFFFFF;
box-shadow: 0 0 0 10px,
10px -10px 0 10px,
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px;
@include animation(checkbox-on $mdb-checkbox-animation-check forwards);
}
& + .checkbox-material:before {
@include animation(rippleOn $mdb-checkbox-animation-ripple);
}
& + .checkbox-material .check:after {
//background-color: $brand-success; // FIXME: seems like tho wrong color, test and make sure it can be removed
@include animation(rippleOn $mdb-checkbox-animation-ripple forwards);
}
}
&:not(:checked) {
& + .checkbox-material:before {
@include animation(rippleOff $mdb-checkbox-animation-ripple);
}
& + .checkbox-material .check:after {
@include animation(rippleOff $mdb-checkbox-animation-ripple); // Ripple effect on uncheck
}
}
}
// Style for disabled inputs
fieldset[disabled] &,
fieldset[disabled] & input[type=checkbox],
input[type=checkbox][disabled] ~ .checkbox-material .check,
input[type=checkbox][disabled] + .circle {
opacity: 0.5;
}
input[type=checkbox][disabled] ~ .checkbox-material .check{
border-color: #000000;
opacity: .26;
}
input[type=checkbox][disabled] + .checkbox-material .check:after {
background-color: $mdb-text-color-primary;
transform: rotate(-45deg);
}
}
@keyframes checkbox-on {
0% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
15px 2px 0 11px;
}
50% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px 2px 0 11px;
}
100% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px;
}
}
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
|