-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomControls.css
219 lines (183 loc) · 4.2 KB
/
customControls.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/* adapted from
https://www.w3schools.com/howto/howto_css_custom_checkbox.asp
https://www.w3schools.com/howto/howto_css_switch.asp
https://www.w3schools.com/howto/howto_css_icon_buttons.asp
*/
/* Create a custom checkbox with a convenient labeled composition*/
/*
<label class="checkBox|radioButton"> TEXT BEFORE
<input type="checkbox" id="... >
<span class="checkmark"></span> TEXT AFTER
</label>
<label class="switch">
<input type="checkbox">
<span class="slider [rounded]"></span>
</label>
<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<button class="btn"><i class="fa fa-home"></i> Home</button>
<button class="btn"><i class="fa fa-bars"></i> Menu</button>
<button class="btn"><i class="fa fa-trash"></i> Trash</button>
<button class="btn"><i class="fa fa-close"></i> Close</button>
<button class="btn"><i class="fa fa-folder"></i> Folder</button>
CURRENT COLORS : #E88004 white
/* Styled buttons */
.btn {
background-color: #E88004;
border: none; /* Remove borders */
color: white; /* White text */
padding: 12px 16px; /* Some padding */
font-size:inherit; /* Set a font size */
cursor: pointer; /* Mouse pointer on hover */
}
/* Darker background on mouse-over */
.btn:hover {
background-color: #E88004;
}
/* The checkBox */
.checkBox {
display: block;
position: relative;
padding-left: 35px;
cursor: pointer;
font-size:inherit;
user-select: none;
}
/* Hide the browser's default checkbox */
input[type="checkbox"] {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
}
/* On mouse-over, add a grey background color */
.checkBox:hover input ~ .checkmark {
background-color: #ccc;
}
/* When the checkbox is checked, add a background */
.checkBox input:checked ~ .checkmark {
background-color: #E88004;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
.checkBox input:checked ~ .checkmark:after {
display: block;
}
/* Style the checkmark/indicator */
.checkBox .checkmark:after {
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 3px 3px 0;
transform: rotate(45deg);
}
/* Customize the label (the radioButton) */
.radioButton {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size:inherit;
user-select: none;
}
/* Hide the browser's default radio button */
.radioButton input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
/* Create a custom radio button */
.radioButton .checkmark {
border-radius: 50%;
}
/* On mouse-over, add a grey background color */
.radioButton:hover input ~ .checkmark {
background-color: #ccc;
}
/* When the radio button is checked, add a blue background */
.radioButton input:checked ~ .checkmark {
background-color: #E88004;
}
/* Show the indicator (dot/circle) when checked */
.radioButton input:checked ~ .checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.radioButton .checkmark:after {
top: 9px;
left: 9px;
width: 8px;
height: 8px;
border-radius: 50%;
background: white;
}
/* Custom Switch */
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
}
input:checked + .slider {
background-color: #E88004;
}
input:focus + .slider {
box-shadow: 0 0 1px #E88004;
}
input:checked + .slider:before {
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}