-
Notifications
You must be signed in to change notification settings - Fork 21
/
formhack.sass
278 lines (212 loc) · 5.29 KB
/
formhack.sass
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/* FormHack v1.2.0 (formhack.io) */
// Config -----------------------------
// Font
$fh-font-family: 'Raleway', sans-serif !default
$fh-font-size: 16px !default
$fh-font-color: rgb(40, 40, 40) !default
// Borders
$fh-border-radius: 5px !default
$fh-border-width: 1px !default
$fh-border-style: solid !default
$fh-border-color: rgb(200, 200, 200) !default
// Inputs, Textareas, Select, Option
$fh-input-height: 40px !default
$fh-input-width: 100% !default
$fh-input-max-width: 400px !default
$fh-input-bg-color: #fff !default
$fh-focus-bg-color: rgb(220, 220, 220) !default
$fh-focus-border-color: $fh-border-color !default
$fh-focus-font-color: $fh-font-color !default
// Select Vendor Styling
$fh-allow-select-vendor-styling: true !default
// Fieldset & Legend Styling
$fh-fieldset-bare: false !default
// Buttons & Input Submits
$fh-button-height: 40px !default
$fh-button-width: 100% !default
$fh-button-max-width: 200px !default
$fh-button-font-color: $fh-font-color !default
$fh-button-bg-color: $fh-focus-bg-color !default
$fh-button-hover-bg-color: $fh-border-color !default
$fh-button-hover-font-color: $fh-font-color !default
// Layout
$fh-centered: false !default
$fh-display: block !default
// Center/Left-Aligned Layout
=center-layout
@if $fh-centered == true
margin: 10px auto
text-align: center
@else
margin: 10px 0
/* Global Reset Styles ------------------ */
input,
textarea,
select,
option,
optgroup,
button,
legend,
fieldset
box-sizing: border-box
font-family: $fh-font-family
font-size: $fh-font-size
color: $fh-font-color
vertical-align: top
outline: none
display: $fh-display
+center-layout
datalist
font-family: $fh-font-family
font-size: $fh-font-size
label
display: $fh-display
+center-layout
/* Input & Textarea ------------------ */
/* Fields with standard width */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="color"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="number"],
input[type="tel"],
input[type="time"],
input[type="url"],
input[type="week"],
input[list],
input[type="file"],
select,
textarea
width: $fh-input-width
max-width: $fh-input-max-width
padding: $fh-input-height / 5
background-color: $fh-input-bg-color
border-radius: $fh-border-radius
border: $fh-border-width $fh-border-style $fh-border-color
/* Fields with standard height */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="color"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="number"],
input[type="tel"],
input[type="time"],
input[type="url"],
input[type="week"],
input[list]
height: $fh-input-height
-webkit-appearance: none
/* Other */
textarea
-webkit-appearance: none
overflow: auto
input[type="range"]
height: $fh-input-height
width: $fh-input-width
max-width: $fh-input-max-width
input[type="file"]
min-height: $fh-input-height
input[type="search"]
height: $fh-input-height
-webkit-appearance: none
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration
-webkit-appearance: none
input[type="checkbox"],
input[type="radio"]
display: inline-block
vertical-align: middle
// For checkbox and radio to be centered, need to wrap the input and label in a span -
// .checkbox-container
// display: block
// text-align: center
//
/* Select ------------------ */
select
height: $fh-input-height
@if $fh-allow-select-vendor-styling == false
-webkit-appearance: none
-moz-appearance: none
-ms-appearance: none
-o-appearance: none
::-ms-expand
display: none
select[multiple]
height: auto
min-height: $fh-input-height
padding: 0
option
margin: 0
padding: $fh-input-height / 5
/* Fieldset ------------------ */
fieldset
@if $fh-fieldset-bare == true
padding: 0
border: 0
@else
padding: 10px 25px
border-radius: $fh-border-radius
border: $fh-border-width $fh-border-style $fh-border-color
legend
@if $fh-fieldset-bare == true
padding: 0
font-weight: inherit
@else
padding: 0 5px
font-weight: 700
/* Buttons, Input Type Submit/Reset ------------------ */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="image"]
height: $fh-button-height
width: $fh-button-width
max-width: $fh-button-max-width
background-color: $fh-button-bg-color
cursor: pointer
padding: $fh-input-height / 5
color: $fh-button-font-color
font-weight: 700
-webkit-appearance: none
-moz-appearance: none
border-radius: $fh-border-radius
border: $fh-border-width $fh-border-style $fh-border-color
input[type="image"]
text-align: center
padding: $fh-input-height / 5
/* States ------------------ */
input[disabled],
textarea[disabled],
select[disabled],
option[disabled],
button[disabled]
cursor: not-allowed
input:focus,
textarea:focus,
select:focus,
option:focus,
button:focus
background-color: $fh-focus-bg-color
border-color: $fh-focus-border-color
input[type="checkbox"]:focus,
input[type="radio"]:focus
outline: $fh-focus-border-color solid 2px
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="reset"]:focus
background-color: $fh-button-hover-bg-color
color: $fh-button-hover-font-color