summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/wyrm/sass/wyrm_core/_form.sass
blob: 3b4a81ca8bcc13b128254b07814d15145361e362 (plain)
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
// Form structure
//
// Files located in `wyrm_core/_form.sass`.
//
// Forms follow the following basic struture. `.wy-control-group`
// wraps the label and a `.wy-control`, which itself warps your actual
// form elements. You can decide either to stack or align your forms.
// A help message can be provided in a couple different styles, but
// the most common is `.wy-form-message` as shown below.
//
// Markup:
// <form class="{$modifiers}">
//   <legend>A simple form</legend>
//   <fieldset>
//     <div class="wy-control-group">
//       <label>Field name</label>
//       <div class="wy-control">
//         <input type="text" placeholder="placeholder"/>
//       </div>
//       <span class="wy-form-message">Help text goes here!</span>
//     </div>
//     <input type="submit" class="btn" />
//   </fieldset>
// </form>
//
// Styleguide 6


.wy-form-stacked
  select
    display: block
.wy-form-aligned
  input, textarea, select, .wy-help-inline, label
    display: inline-block
    *display: inline
    *zoom: 1
    vertical-align: middle

.wy-form-aligned
  .wy-control-group
    > label
      display: inline-block
      vertical-align: middle
      width: 10em
      margin: $base-line-height / 4 $base-line-height / 2 0 0
      float: left
  .wy-control
    float: left
    label
      display: block
    select
      margin-top: $base-line-height / 4

fieldset
  border: 0
  margin: 0
  padding: 0
legend
  display: block
  width: 100%
  border: 0
  padding: 0
  white-space: normal
  margin-bottom: $base-line-height
  font-size: 150%
  *margin-left: -7px
label
  display: block
  margin: 0 0 em(5px) 0
  color: $gray-dark
  font-size: 90%

input, select, textarea
  font-size: 100%
  margin: 0
  vertical-align: baseline
  *vertical-align: middle


.wy-control-group
  margin-bottom: $base-line-height
  +outer-container
  +clearfix

.wy-control-group.wy-control-group-required > label:after
  content: " *"
  color: $red

// For doing multi part, aligned form blocks within a single label

.wy-control-group
  .wy-form-full, .wy-form-halves, .wy-form-thirds
    padding-bottom: $base-line-height / 2
    select
      width: 100%
    input
      &[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
        width: 100%
.wy-control-group .wy-form-full
  +span-columns(12)
  +omega-type

.wy-control-group .wy-form-halves
  +span-columns(6)
  +omega-type(2n)

.wy-control-group .wy-form-thirds
  +span-columns(4)
  +omega-type(3n)

// Sometimes you just output text in a form, not an actual input
.wy-control-group.wy-control-group-no-input .wy-control
  margin: $base-line-height / 4 0 0 0
  font-size: 90%

.wy-control-no-input
  display: inline-block
  margin: $base-line-height / 4 0 0 0
  font-size: 90%


// Fluid inputs when needed

.wy-control-group.fluid-input
  input
    &[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
      width: 100%

// Inline help for forms

.wy-form-message-inline
  display: inline-block
  padding-left: 0.3em
  color: #666
  vertical-align: middle
  font-size: 90%

.wy-form-message
  display: block
  color: $gray-light
  font-size: 70%
  margin-top: em(5px)
  font-style: italic
  p
    font-size: inherit
    font-style: italic
    margin-bottom: $base-line-height / 4
  p:last-child
    margin-bottom: 0

// Generic form elements
//
// Here's the output of common form inputs. The sass itself covers more types
// like email, password, url, date...etc, but I've left them out for brevity.
//
// Markup:
// <div class="wy-control-group">
//   <label>Text field</label>
//   <div class="wy-control">
//     <input type="text" placeholder="placeholder"/>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Textarea</label>
//   <div class="wy-control">
//     <textarea></textarea>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Dropdown</label>
//   <div class="wy-control">
//     <select>
//       <option></option>
//       <option>Option 1</option>
//       <option>Option 2</option>
//     </select>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Radio</label>
//   <div class="wy-control">
//     <label class="wy-radio">
//       <input type="radio">
//       Option 1
//     </label>
//     <label class="wy-radio">
//       <input type="radio">
//       Option 2
//     </label>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Checkbox</label>
//   <div class="wy-control">
//     <label class="wy-checkbox">
//       <input type="checkbox">
//       Option 1
//     </label>
//     <label class="wy-checkbox">
//       <input type="checkbox">
//       Option 2
//     </label>
//   </div>
// </div>
//
// Styleguide 6.1


input
  line-height: normal

input
  &[type="button"], &[type="reset"], &[type="submit"]
    -webkit-appearance: button
    cursor: pointer
    font-family: $base-font-family
    *overflow: visible
  &[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
    -webkit-appearance: none
    padding: $base-line-height / 4
    display: inline-block
    border: 1px solid $input-border-color
    font-size: 80%
    font-family: $base-font-family
    box-shadow: inset 0 1px 3px $input-shadow-color
    border-radius: 0
    +transition(border .3s linear)
    +font-smooth
  &[type="datetime-local"]
    padding: em(5.5px) em(10px)
  &[disabled]
    cursor: default
  &[type="checkbox"], &[type="radio"]
    +box-sizing(border-box)
    padding: 0
    margin-right: em(5px)
    *height: 13px
    *width: 13px
  &[type="search"]
    +box-sizing(border-box)
    &::-webkit-search-cancel-button, &::-webkit-search-decoration
      -webkit-appearance: none
  &[type="text"]:focus, &[type="password"]:focus, &[type="email"]:focus, &[type="url"]:focus, &[type="date"]:focus, &[type="month"]:focus, &[type="time"]:focus, &[type="datetime"]:focus, &[type="datetime-local"]:focus, &[type="week"]:focus, &[type="number"]:focus, &[type="search"]:focus, &[type="tel"]:focus, &[type="color"]:focus
    outline: 0
    outline: thin dotted \9
    border-color: $input-focus-color
  &.no-focus:focus
    border-color: $input-border-color !important
  &[type="file"]:focus, &[type="radio"]:focus, &[type="checkbox"]:focus
    outline: thin dotted $gray-dark
    outline: 1px auto #129FEA
  &[type="text"][disabled], &[type="password"][disabled], &[type="email"][disabled], &[type="url"][disabled], &[type="date"][disabled], &[type="month"][disabled], &[type="time"][disabled], &[type="datetime"][disabled], &[type="datetime-local"][disabled], &[type="week"][disabled], &[type="number"][disabled], &[type="search"][disabled], &[type="tel"][disabled], &[type="color"][disabled]
    cursor: not-allowed
    background-color: darken($input-background-color, 2%)

input:focus:invalid, textarea:focus:invalid, select:focus:invalid
  color: $red
  border: 1px solid $red
input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus
  border-color: $red
input
  &[type="file"]:focus:invalid:focus, &[type="radio"]:focus:invalid:focus, &[type="checkbox"]:focus:invalid:focus
    outline-color: $red

input.wy-input-large
  padding: $base-line-height / 2
  font-size: 100%


// Textareas and selects

textarea
  overflow: auto
  vertical-align: top
  width: 100%
  font-family: $base-font-family
select, textarea
  padding: em(8px) em(10px)
  display: inline-block
  border: 1px solid $input-border-color
  font-size: 80%
  box-shadow: inset 0 1px 3px $input-shadow-color
  +transition(border .3s linear)
  +font-smooth
select
  border: 1px solid $input-border-color
  background-color: $input-background-color
  &[multiple]
    height: auto
select:focus, textarea:focus
  outline: 0
select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly]
  cursor: not-allowed
  background-color: darken($input-background-color, 2%)

// Checkboxes and radios

input
  &[type="radio"][disabled], &[type="checkbox"][disabled]
    cursor: not-allowed
.wy-checkbox, .wy-radio
  margin: $base-line-height / 4 0
  // Important because we don't want it overwritten in the case of errors
  color: $text-color
  display: block
  input
    vertical-align: baseline

// Messages and input context

.wy-form-message-inline
  display: inline-block
  *display: inline
  *zoom: 1
  vertical-align: middle

// Prefix and suffix for inputs
//
// Wyrm allows some basic prefix and suffic styling for text inputs.
//
// Markup:
// <div class="wy-control-group">
//   <label>Prefix</label>
//   <div class="wy-control wy-input-prefix">
//     <span class="wy-input-context">@</span><input type="text" placeholder="placeholder"/>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Suffix</label>
//   <div class="wy-control wy-input-suffix">
//     <input type="text" placeholder="placeholder"/><span class="wy-input-context">@gmail.com</span>
//   </div>
// </div>
//
// Styleguide 6.2


.wy-input-prefix, .wy-input-suffix
  white-space: nowrap
  padding: $base-line-height / 4
  .wy-input-context
    line-height: 27px // Hack for the moment.
    padding: 0 8px
    display: inline-block
    font-size: 80%
    background-color: $table-stripe-color
    border: solid 1px $input-border-color
    color: $gray-light

.wy-input-suffix .wy-input-context
  border-left: 0
.wy-input-prefix .wy-input-context
  border-right: 0

// Switches
//
// True / false, boolean style switches.
//
// Markup:
// <div class="wy-switch {$modifiers}"><span>Here is some really long text.</span></div>
//
// .active          - active state.
// .disabled          - disabled.
//
// Styleguide 6.3

.wy-switch
  position: relative
  display: block
  height: $base-line-height
  margin-top: $base-line-height / 2
  cursor: pointer
  &:before
    position: absolute
    content: ""
    display: block
    left: 0
    top: 0
    width: $base-line-height * 1.5
    height: $base-line-height / 2
    border-radius: 4px
    background: $gray-lighter
    +transition(all .2s ease-in-out)
  &:after
    position: absolute
    content: ""
    display: block
    width: 18px
    height: 18px
    border-radius: 4px
    background: $gray-light
    left: -3px
    top: -3px
    +transition(all .2s ease-in-out)
  span
    position: absolute
    left: $base-line-height * 2
    display: block
    font-size: 12px
    color: $gray-lighter
    line-height: 1
.wy-switch.active
  &:before
    background: darken($green, 10%)
  &:after
    left: $base-line-height
    background: $green

.wy-switch.disabled
  cursor: not-allowed
  opacity: .8


// Error handling and inline validation
//
// Wyrm has both block and inline level validation depending upon your needs. You can also
// pair these with the global alerts mentioned in the alerts section of this styleguide.
//
// Markup:
// <div class="wy-control-group wy-control-group-error">
//   <label>After the fact error</label>
//   <div class="wy-control">
//     <input type="text" placeholder="placeholder"/>
//     <span class="wy-form-message">Error text goes here.</span>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Inline success</label>
//   <div class="wy-control wy-inline-validate wy-inline-validate-info">
//     <input type="text" placeholder="placeholder"/>
//     <span class="wy-input-context"> You may want to do this.</span>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Inline success</label>
//   <div class="wy-control wy-inline-validate wy-inline-validate-success">
//     <input type="text" placeholder="placeholder"/>
//     <span class="wy-input-context"> Woot, way to go.</span>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Inline error</label>
//   <div class="wy-control wy-inline-validate wy-inline-validate-warning">
//     <input type="text" placeholder="placeholder"/>
//     <span class="wy-input-context"> Hold on cowboy.</span>
//   </div>
// </div>
// <div class="wy-control-group">
//   <label>Inline error</label>
//   <div class="wy-control wy-inline-validate wy-inline-validate-danger">
//     <input type="text" placeholder="placeholder"/>
//     <span class="wy-input-context"> Damnit, you messed up.</span>
//   </div>
// </div>
//
// Styleguide 6.4

.wy-control-group.wy-control-group-error
  .wy-form-message, > label
    color: $red
  input
    &[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
      border: solid 1px $red
  textarea
    border: solid 1px $red

.wy-inline-validate
  white-space: nowrap
  .wy-input-context
    padding: em(8px) em(10px)
    display: inline-block
    font-size: 80%
.wy-inline-validate.wy-inline-validate-success .wy-input-context
  color: $green
  @extend %icon
  @extend .#{$icon-prefix}-#{$icon-ok}
.wy-inline-validate.wy-inline-validate-danger .wy-input-context
  color: $red
  @extend %icon
  @extend .#{$icon-prefix}-#{$icon-remove}
.wy-inline-validate.wy-inline-validate-warning .wy-input-context
  color: $orange
  @extend %icon
  @extend .#{$icon-prefix}-#{$icon-alert}
.wy-inline-validate.wy-inline-validate-info .wy-input-context
  color: $blue
  @extend %icon
  @extend .#{$icon-prefix}-#{$icon-alert}

// Some generic rotation classes for reading user images

.rotate-90
  @include transform(rotate(90deg))
.rotate-180
  @include transform(rotate(180deg))
.rotate-270
  @include transform(rotate(270deg))
.mirror
  @include transform(scaleX(-1))
  &.rotate-90
    @include transform(scaleX(-1) rotate(90deg))
  &.rotate-180
    @include transform(scaleX(-1) rotate(180deg))
  &.rotate-270
    @include transform(scaleX(-1) rotate(270deg))

@media only screen and (max-width: 480px)
  .wy-form
    button[type="submit"]
      margin: 0.7em 0 0
    input
      &[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
        margin-bottom: 0.3em
        display: block
    label
      margin-bottom: 0.3em
      display: block
  .wy-form input
    &[type="password"], &[type="email"], &[type="url"], &[type="date"], &[type="month"], &[type="time"], &[type="datetime"], &[type="datetime-local"], &[type="week"], &[type="number"], &[type="search"], &[type="tel"], &[type="color"]
      margin-bottom: 0
  .wy-form-aligned
    .wy-control-group label
      margin-bottom: 0.3em
      text-align: left
      display: block
      width: 100%
    .wy-control
      margin: 1.5em 0 0 0
  .wy-form .wy-help-inline, .wy-form-message-inline, .wy-form-message
    display: block
    font-size: 80%
    padding: $base-line-height / 4 0