-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmagic-input.styl
174 lines (166 loc) · 3.11 KB
/
magic-input.styl
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
@import './mixins'
.mgc{
input-checkbox()
input-checkbox-color(#fff,#d7d7d7,#414141)
}
.mgc-primary{
input-checkbox-color(#337ab7,#337ab7,#fff)
}
.mgc-success{
input-checkbox-color(#5cb85c,#5cb85c,#fff)
}
.mgc-info{
input-checkbox-color(#5bc0de,#5bc0de,#fff)
}
.mgc-warning{
input-checkbox-color(#f0ad4e,#f0ad4e,#fff)
}
.mgc-danger{
input-checkbox-color(#cf3b3a,#cf3b3a,#fff)
}
.mgc-circle{
border-radius 50%
}
.mgc-sm{
width 12px
height 12px
&:checked:after{
top 2px
left 1px
height 3px
width 6px
}
}
.mgc-lg{
width 19px
height 19px
&:checked:after{
top 3px
left 3px
height 5px
width 10px
}
}
input[type="radio"].mgr{
input-radio()
input-radio-color(#fff,#555555)
}
.mgr-primary{
input-radio-color(#337ab7,#337ab7)
}
.mgr-success{
input-radio-color(#5cb85c,#5cb85c)
}
.mgr-info{
input-radio-color(#5bc0de,#5bc0de)
}
.mgr-warning{
input-radio-color(#f0ad4e,#f0ad4e)
}
.mgr-danger{
input-radio-color(#cf3b3a,#cf3b3a)
}
.mgr-sm{
width 12px
height 12px
&:checked:before{
height 6px
width 6px
border-radius 50%
margin 2px 0 0 2px
}
}
.mgr-lg{
width 19px
height 19px
&:checked:before{
height 11px
width 11px
border-radius 50%
margin 3px 0 0 3px
}
}
$mgcSwitchHeight ?= 24px;
.mgc-switch{
appearance: none;
position: relative;
width: 41px;
height: $mgcSwitchHeight;
border: 1px solid #DFDFDF;
outline: 0;
border-radius: 16px;
box-sizing: border-box;
background: #DFDFDF;
&:before,&:after{
content: " ";
position: absolute;
top: 0;
left: 0;
border-radius: 15px;
transition:transform .3s;
}
&:before{
width: 39px;
height: $mgcSwitchHeight - 2;
background-color: #FDFDFD;
}
&:after{
width: $mgcSwitchHeight - 2;
height: $mgcSwitchHeight - 2;
background-color: #FFFFFF;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
&:checked{
border-color: #04BE02;
background-color: #04BE02;
&:before{
transform: scale(0);
}
&:after{
transform: translateX(17px);
}
}
&:focus{
outline: 0;
}
}
$mgcSwitchHeight =20px
.mgc-sm.mgc-switch{
height: $mgcSwitchHeight;
width: 32px;
&:before{
height: $mgcSwitchHeight - 2;
width: 30px;
}
&:after{
width: $mgcSwitchHeight - 2;
height: $mgcSwitchHeight - 2;
}
&:checked{
&:after{
top: 0px;
left: 2px;
transform: translateX(10px);
}
}
}
$mgcSwitchHeight =32px
.mgc-lg.mgc-switch{
height: $mgcSwitchHeight;
width: 52px;
&:before{
height: $mgcSwitchHeight - 2;
width: 50px;
}
&:after{
width: $mgcSwitchHeight - 2;
height: $mgcSwitchHeight - 2;
}
&:checked{
&:after{
top: 0px;
left: 2px;
transform: translateX(18px);
}
}
}