Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13542 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, 0, 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
 
83
.item-input-inset {
84
  @include display-flex();
85
  @include align-items(center);
86
  position: relative;
87
  overflow: hidden;
88
  padding: ($item-padding / 3) * 2;
89
}
90
 
91
.item-input-wrapper {
92
  @include display-flex();
93
  @include flex(1, 0);
94
  @include align-items(center);
95
  @include border-radius(4px);
96
  padding-right: 8px;
97
  padding-left: 8px;
98
  background: #eee;
99
}
100
 
101
.item-input-inset .item-input-wrapper input {
102
  padding-left: 4px;
103
  height: 29px;
104
  background: transparent;
105
  line-height: 18px;
106
}
107
 
108
.item-input-wrapper ~ .button {
109
  margin-left: ($item-padding / 3) * 2;
110
}
111
 
112
.input-label {
113
  @include flex(1, 0, 100px);
114
  display: table;
115
  padding: 7px 10px 7px 0px;
116
  max-width: 200px;
117
  width: 35%;
118
  color: $input-label-color;
119
  font-size: 16px;
120
}
121
 
122
.placeholder-icon {
123
  color: #aaa;
124
  &:first-child {
125
    padding-right: 6px;
126
  }
127
  &:last-child {
128
    padding-left: 6px;
129
  }
130
}
131
 
132
.item-stacked-label {
133
  display: block;
134
  background-color: transparent;
135
  box-shadow: none;
136
 
137
  .input-label, .icon {
138
    display: inline-block;
139
    padding: 4px 0 0 0px;
140
    vertical-align: middle;
141
  }
142
}
143
 
144
.item-stacked-label input,
145
.item-stacked-label textarea {
146
  @include border-radius(2px);
147
  padding: 4px 8px 3px 0;
148
  border: none;
149
  background-color: $input-bg;
150
}
151
.item-stacked-label input {
152
  overflow: hidden;
153
  height: $line-height-computed + $font-size-base + 12px;
154
}
155
 
156
.item-floating-label {
157
  display: block;
158
  background-color: transparent;
159
  box-shadow: none;
160
 
161
  .input-label {
162
    position: relative;
163
    padding: 5px 0 0 0;
164
    opacity: 0;
165
    top: 10px;
166
    @include transition(opacity .15s ease-in, top .2s linear);
167
 
168
    &.has-input {
169
      opacity: 1;
170
      top: 0;
171
      @include transition(opacity .15s ease-in, top .2s linear);
172
    }
173
  }
174
}
175
 
176
 
177
// Form Controls
178
// -------------------------------
179
 
180
// Shared size and type resets
181
textarea,
182
input[type="text"],
183
input[type="password"],
184
input[type="datetime"],
185
input[type="datetime-local"],
186
input[type="date"],
187
input[type="month"],
188
input[type="time"],
189
input[type="week"],
190
input[type="number"],
191
input[type="email"],
192
input[type="url"],
193
input[type="search"],
194
input[type="tel"],
195
input[type="color"] {
196
  display: block;
197
  padding-top: 2px;
198
  padding-left: 0;
199
  height: $line-height-computed + $font-size-base;
200
  color: $input-color;
201
  vertical-align: middle;
202
  font-size: $font-size-base;
203
  line-height: $font-size-base + 2;
204
}
205
 
206
.platform-ios,
207
.platform-android {
208
  input[type="datetime-local"],
209
  input[type="date"],
210
  input[type="month"],
211
  input[type="time"],
212
  input[type="week"] {
213
    padding-top: 8px;
214
  }
215
}
216
 
217
input,
218
textarea {
219
  width: 100%;
220
}
221
textarea {
222
  padding-left: 0;
223
  @include placeholder($input-color-placeholder, -3px);
224
}
225
 
226
// Reset height since textareas have rows
227
textarea {
228
  height: auto;
229
}
230
 
231
// Everything else
232
textarea,
233
input[type="text"],
234
input[type="password"],
235
input[type="datetime"],
236
input[type="datetime-local"],
237
input[type="date"],
238
input[type="month"],
239
input[type="time"],
240
input[type="week"],
241
input[type="number"],
242
input[type="email"],
243
input[type="url"],
244
input[type="search"],
245
input[type="tel"],
246
input[type="color"] {
247
  border: 0;
248
}
249
 
250
// Position radios and checkboxes better
251
input[type="radio"],
252
input[type="checkbox"] {
253
  margin: 0;
254
  line-height: normal;
255
}
256
 
257
// Reset width of input images, buttons, radios, checkboxes
258
input[type="file"],
259
input[type="image"],
260
input[type="submit"],
261
input[type="reset"],
262
input[type="button"],
263
input[type="radio"],
264
input[type="checkbox"] {
265
  width: auto; // Override of generic input selector
266
}
267
 
268
// Set the height of file to match text inputs
269
input[type="file"] {
270
  line-height: $input-height-base;
271
}
272
 
273
// Text input classes to hide text caret during scroll
274
.previous-input-focus,
275
.cloned-text-input + input,
276
.cloned-text-input + textarea {
277
  position: absolute !important;
278
  left: -9999px;
279
  width: 200px;
280
}
281
 
282
 
283
// Placeholder
284
// -------------------------------
285
input,
286
textarea {
287
  @include placeholder();
288
}
289
 
290
 
291
// DISABLED STATE
292
// -------------------------------
293
 
294
// Disabled and read-only inputs
295
input[disabled],
296
select[disabled],
297
textarea[disabled],
298
input[readonly]:not(.cloned-text-input),
299
textarea[readonly]:not(.cloned-text-input),
300
select[readonly] {
301
  background-color: $input-bg-disabled;
302
  cursor: not-allowed;
303
}
304
// Explicitly reset the colors here
305
input[type="radio"][disabled],
306
input[type="checkbox"][disabled],
307
input[type="radio"][readonly],
308
input[type="checkbox"][readonly] {
309
  background-color: transparent;
310
}