Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15747 anikendra 1
/**
2
 * Forms
3
 * --------------------------------------------------
4
 */
5
 
6
// Make all forms have space below them
7
form {
8
  margin: 0 0 $line-height-base;
9
}
10
 
11
// Groups of fields with labels on top (legends)
12
legend {
13
  display: block;
14
  margin-bottom: $line-height-base;
15
  padding: 0;
16
  width: 100%;
17
  border: $input-border-width solid $input-border;
18
  color: $dark;
19
  font-size: $font-size-base * 1.5;
20
  line-height: $line-height-base * 2;
21
 
22
  small {
23
    color: $stable;
24
    font-size: $line-height-base * .75;
25
  }
26
}
27
 
28
// Set font for forms
29
label,
30
input,
31
button,
32
select,
33
textarea {
34
  @include font-shorthand($font-size-base, normal, $line-height-base); // Set size, weight, line-height here
35
}
36
input,
37
button,
38
select,
39
textarea {
40
  font-family: $font-family-base; // And only set font-family here for those that need it (note the missing label element)
41
}
42
 
43
 
44
// Input List
45
// -------------------------------
46
 
47
.item-input {
48
  @include display-flex();
49
  @include align-items(center);
50
  position: relative;
51
  overflow: hidden;
52
  padding: 6px 0 5px 16px;
53
 
54
  input {
55
    @include border-radius(0);
56
    @include flex(1, 220px);
57
    @include appearance(none);
58
    margin: 0;
59
    padding-right: 24px;
60
    background-color: transparent;
61
  }
62
 
63
  .button .icon {
64
    @include flex(0, 0, 24px);
65
    position: static;
66
    display: inline-block;
67
    height: auto;
68
    text-align: center;
69
    font-size: 16px;
70
  }
71
 
72
  .button-bar {
73
    @include border-radius(0);
74
    @include flex(1, 0, 220px);
75
    @include appearance(none);
76
  }
77
 
78
  .icon {
79
    min-width: 14px;
80
  }
81
}
82
// prevent flex-shrink on WP
83
.platform-windowsphone .item-input input{
84
  flex-shrink: 1;
85
}
86
 
87
.item-input-inset {
88
  @include display-flex();
89
  @include align-items(center);
90
  position: relative;
91
  overflow: hidden;
92
  padding: ($item-padding / 3) * 2;
93
}
94
 
95
.item-input-wrapper {
96
  @include display-flex();
97
  @include flex(1, 0);
98
  @include align-items(center);
99
  @include border-radius(4px);
100
  padding-right: 8px;
101
  padding-left: 8px;
102
  background: #eee;
103
}
104
 
105
.item-input-inset .item-input-wrapper input {
106
  padding-left: 4px;
107
  height: 29px;
108
  background: transparent;
109
  line-height: 18px;
110
}
111
 
112
.item-input-wrapper ~ .button {
113
  margin-left: ($item-padding / 3) * 2;
114
}
115
 
116
.input-label {
117
  display: table;
118
  padding: 7px 10px 7px 0px;
119
  max-width: 200px;
120
  width: 35%;
121
  color: $input-label-color;
122
  font-size: 16px;
123
}
124
 
125
.placeholder-icon {
126
  color: #aaa;
127
  &:first-child {
128
    padding-right: 6px;
129
  }
130
  &:last-child {
131
    padding-left: 6px;
132
  }
133
}
134
 
135
.item-stacked-label {
136
  display: block;
137
  background-color: transparent;
138
  box-shadow: none;
139
 
140
  .input-label, .icon {
141
    display: inline-block;
142
    padding: 4px 0 0 0px;
143
    vertical-align: middle;
144
  }
145
}
146
 
147
.item-stacked-label input,
148
.item-stacked-label textarea {
149
  @include border-radius(2px);
150
  padding: 4px 8px 3px 0;
151
  border: none;
152
  background-color: $input-bg;
153
}
154
.item-stacked-label input {
155
  overflow: hidden;
156
  height: $line-height-computed + $font-size-base + 12px;
157
}
158
 
159
.item-floating-label {
160
  display: block;
161
  background-color: transparent;
162
  box-shadow: none;
163
 
164
  .input-label {
165
    position: relative;
166
    padding: 5px 0 0 0;
167
    opacity: 0;
168
    top: 10px;
169
    @include transition(opacity .15s ease-in, top .2s linear);
170
 
171
    &.has-input {
172
      opacity: 1;
173
      top: 0;
174
      @include transition(opacity .15s ease-in, top .2s linear);
175
    }
176
  }
177
}
178
 
179
 
180
// Form Controls
181
// -------------------------------
182
 
183
// Shared size and type resets
184
textarea,
185
input[type="text"],
186
input[type="password"],
187
input[type="datetime"],
188
input[type="datetime-local"],
189
input[type="date"],
190
input[type="month"],
191
input[type="time"],
192
input[type="week"],
193
input[type="number"],
194
input[type="email"],
195
input[type="url"],
196
input[type="search"],
197
input[type="tel"],
198
input[type="color"] {
199
  display: block;
200
  padding-top: 2px;
201
  padding-left: 0;
202
  height: $line-height-computed + $font-size-base;
203
  color: $input-color;
204
  vertical-align: middle;
205
  font-size: $font-size-base;
206
  line-height: $font-size-base + 2;
207
}
208
 
209
.platform-ios,
210
.platform-android {
211
  input[type="datetime-local"],
212
  input[type="date"],
213
  input[type="month"],
214
  input[type="time"],
215
  input[type="week"] {
216
    padding-top: 8px;
217
  }
218
}
219
 
220
.item-input {
221
  input,
222
  textarea {
223
    width: 100%;
224
  }
225
}
226
 
227
textarea {
228
  padding-left: 0;
229
  @include placeholder($input-color-placeholder, -3px);
230
}
231
 
232
// Reset height since textareas have rows
233
textarea {
234
  height: auto;
235
}
236
 
237
// Everything else
238
textarea,
239
input[type="text"],
240
input[type="password"],
241
input[type="datetime"],
242
input[type="datetime-local"],
243
input[type="date"],
244
input[type="month"],
245
input[type="time"],
246
input[type="week"],
247
input[type="number"],
248
input[type="email"],
249
input[type="url"],
250
input[type="search"],
251
input[type="tel"],
252
input[type="color"] {
253
  border: 0;
254
}
255
 
256
// Position radios and checkboxes better
257
input[type="radio"],
258
input[type="checkbox"] {
259
  margin: 0;
260
  line-height: normal;
261
}
262
 
263
// Reset width of input images, buttons, radios, checkboxes
264
.item-input {
265
  input[type="file"],
266
  input[type="image"],
267
  input[type="submit"],
268
  input[type="reset"],
269
  input[type="button"],
270
  input[type="radio"],
271
  input[type="checkbox"] {
272
    width: auto; // Override of generic input selector
273
  }
274
}
275
 
276
// Set the height of file to match text inputs
277
input[type="file"] {
278
  line-height: $input-height-base;
279
}
280
 
281
// Text input classes to hide text caret during scroll
282
.previous-input-focus,
283
.cloned-text-input + input,
284
.cloned-text-input + textarea {
285
  position: absolute !important;
286
  left: -9999px;
287
  width: 200px;
288
}
289
 
290
 
291
// Placeholder
292
// -------------------------------
293
input,
294
textarea {
295
  @include placeholder();
296
}
297
 
298
 
299
// DISABLED STATE
300
// -------------------------------
301
 
302
// Disabled and read-only inputs
303
input[disabled],
304
select[disabled],
305
textarea[disabled],
306
input[readonly]:not(.cloned-text-input),
307
textarea[readonly]:not(.cloned-text-input),
308
select[readonly] {
309
  background-color: $input-bg-disabled;
310
  cursor: not-allowed;
311
}
312
// Explicitly reset the colors here
313
input[type="radio"][disabled],
314
input[type="checkbox"][disabled],
315
input[type="radio"][readonly],
316
input[type="checkbox"][readonly] {
317
  background-color: transparent;
318
}