_form-adv-checkbox.scss
2.41 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
121
122
123
.checkbox-adv {
font-size: $font-size;
line-height: $line-height;
[class^="circle"] {
display: block;
height: $font-size;
position: absolute;
top: (($line-height - $font-size) / 2 - 1);
left: 0;
width: $font-size;
}
.circle {
border: 2px solid $black-sec;
@include transition(border-color 0.3s $timing);
}
&.disabled,
fieldset[disabled] & {
.circle {
border-color: $black-hint !important;
}
}
input.access-hide:focus ~ .circle {
border-color: $black-text;
}
input.access-hide:checked ~ .circle {
border-color: $brand-color;
}
.circle-check {
background-color: transparent;
@include transform(scale(0));
@include transition(all 0.3s $timing);
-webkit-transition-property: background-color, -webkit-transform;
transition-property: background-color, transform;
&:after {
background-color: $brand-color;
border-radius: 50%;
content: "";
display: block;
height: ($font-size * 5);
position: absolute;
top: ($font-size * -2);
left: ($font-size * -2);
width: ($font-size * 5);
@include opacity(0);
}
}
&.disabled,
fieldset[disabled] & {
.circle-check:after {
background-color: $black-hint;
}
}
input.access-hide:checked ~ .circle-check {
@include transform(scale(0.5));
&:after {
@include animation(circle-check 0.6s);
}
}
.circle-icon {
background-color: transparent;
color: transparent;
@include transform(scale(0.5));
@include transition(all 0.3s $timing);
-webkit-transition-property: background-color, color, -webkit-transform;
transition-property: background-color, color, transform;
&:before {
// position
top: auto;
}
}
input.access-hide:checked ~ .circle-icon {
background-color: $brand-color;
color: $white;
@include transform(scale(1));
}
&.disabled,
fieldset[disabled] & {
input.access-hide:checked ~ .circle-icon {
background-color: $black-hint;
}
}
}
.radio-adv {
@extend .checkbox-adv;
[class^="circle"] {
border-radius: 50%;
}
input.access-hide:checked ~ .circle-check {
background-color: $brand-color;
}
&.disabled,
fieldset[disabled] & {
input.access-hide:checked ~ .circle-check {
background-color: $black-hint;
}
}
}
// animation
@-webkit-keyframes circle-check {
0% {
opacity: 0;
}
25% {
opacity: 0.25;
}
100% {
opacity: 0;
}
}
@keyframes circle-check {
0% {
opacity: 0;
}
25% {
opacity: 0.25;
}
100% {
opacity: 0;
}
}