Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// stylelint-disable selector-no-qualifying-type
2
 
3
//
4
// Textual form controls
5
//
6
 
7
.form-control,
8
select[size],
9
select[multiple],
10
.comment-area textarea,
11
textarea.quickgrade,
12
[type="text"],
13
[name="subject"],
14
.path-mod-assign [data-region="grade-panel"] .gradingform_rubric .criterion .remark textarea,
15
.usp-search-field,
16
#email_email {
17
  display: inline-block;
18
  width: auto;
19
  height: $input-height;
20
  padding: $input-padding-y $input-padding-x;
21
  font-family: $input-font-family;
22
  @include font-size($input-font-size);
23
  font-weight: $input-font-weight;
24
  line-height: $input-line-height;
25
  color: $input-color;
26
  background-color: $input-bg;
27
  background-clip: padding-box;
28
  border: $input-border-width solid $input-border-color;
29
 
30
  box-shadow: inset 0 2px 3px 0 rgba(0, 0, 0, 0.11);
31
 
32
  // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
33
  border-radius: $btn-border-radius;
34
 
35
  @include box-shadow($input-box-shadow);
36
  @include transition($input-transition);
37
 
38
  .theme-dark & {
39
    color: $dm-input-color !important;
40
    background-color: $dm-input-bg;
41
    border: $input-border-width solid $dm-input-border-color;
42
  }
43
 
44
  // Unstyle the caret on `<select>`s in IE10+.
45
  &::-ms-expand {
46
    background-color: transparent;
47
    border: 0;
48
  }
49
 
50
  // Remove select outline from select box in FF
51
  &:-moz-focusring {
52
    color: transparent;
53
    text-shadow: 0 0 0 $input-color;
54
 
55
    .theme-dark & {
56
      text-shadow: 0 0 0 $dm-input-color;
57
    }
58
  }
59
 
60
  // Customize the `:focus` state to imitate native WebKit styles.
61
  @include form-control-focus($ignore-warning: true);
62
 
63
  // Placeholder
64
  &::placeholder {
65
    color: $input-placeholder-color;
66
    // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
67
    opacity: 1;
68
 
69
    .theme-dark & {
70
      color: $dm-input-placeholder-color;
71
    }
72
  }
73
 
74
  // Disabled and read-only inputs
75
  //
76
  // HTML5 says that controls under a fieldset > legend:first-child won't be
77
  // disabled if the fieldset is disabled. Due to implementation difficulty, we
78
  // don't honor that edge case; we style them as disabled anyway.
79
  &:disabled,
80
  &[readonly] {
81
    background-color: $input-disabled-bg;
82
    // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
83
    opacity: 1;
84
 
85
    .theme-dark & {
86
      opacity: .7;
87
      background-color: $dm-input-disabled-bg;
88
    }
89
  }
90
}
91
 
92
input[type="date"],
93
input[type="time"],
94
input[type="datetime-local"],
95
input[type="month"] {
96
  &.form-control {
97
    appearance: none; // Fix appearance for date inputs in Safari
98
  }
99
}
100
 
101
select[size],
102
select[multiple],
103
select.form-control {
104
 
105
  option {
106
    padding: 0.5rem;
107
    margin-bottom: 0.25rem;
108
    border-radius: $btn-border-radius;
109
    font-size: $font-size-sm;
110
    white-space: break-spaces;
111
 
112
    &::before {
113
      display: none;
114
    }
115
 
116
    &[disabled="disabled"] {
117
      display: none;
118
    }
119
 
120
    &:last-child {
121
      margin-bottom: 0;
122
    }
123
  }
124
 
125
  &:focus::-ms-value {
126
    // Suppress the nested default white text on blue background highlight given to
127
    // the selected option text when the (still closed) <select> receives focus
128
    // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
129
    // match the appearance of the native widget.
130
    // See https://github.com/twbs/bootstrap/issues/19398.
131
    color: $input-color;
132
    background-color: $input-bg;
133
 
134
    .theme-dark & {
135
      color: $dm-input-color !important;
136
      background-color: $dm-input-bg;
137
    }
138
  }
139
}
140
 
141
// Make file inputs better match text inputs by forcing them to new lines.
142
.form-control-file,
143
.form-control-range {
144
  display: block;
145
  width: 100%;
146
}
147
 
148
 
149
//
150
// Labels
151
//
152
 
153
// For use with horizontal and inline forms, when you need the label (or legend)
154
// text to align with the form controls.
155
.col-form-label {
156
  margin-bottom: 0; // Override the `<label>/<legend>` default
157
  @include font-size(inherit); // Override the `<legend>` default
158
  font-weight: $font-weight-medium;
159
  line-height: $input-line-height;
160
 
161
  label {
162
    display: inline-flex;
163
    align-items: center;
164
 
165
    .rui-icon-container {
166
      margin: 0 .35rem;
167
 
168
      .icon {
169
        width: 20px;
170
        height: 20px;
171
      }
172
    }
173
  }
174
}
175
 
176
.col-form-label-lg {
177
  padding-top: add($input-padding-y-lg, $input-border-width);
178
  padding-bottom: add($input-padding-y-lg, $input-border-width);
179
  @include font-size($input-font-size-lg);
180
  font-weight: $font-weight-medium;
181
  line-height: $input-line-height-lg;
182
}
183
 
184
.col-form-label-sm {
185
  padding-top: add($input-padding-y-sm, $input-border-width);
186
  padding-bottom: add($input-padding-y-sm, $input-border-width);
187
  @include font-size($input-font-size-sm);
188
  font-weight: $font-weight-medium;
189
  line-height: $input-line-height-sm;
190
}
191
 
192
 
193
// Readonly controls as plain text
194
//
195
// Apply class to a readonly input to make it appear like regular plain
196
// text (without any border, background color, focus indicator)
197
 
198
.form-control-plaintext {
199
  display: block;
200
  width: 100%;
201
  padding: $input-padding-y 0;
202
  margin-bottom: 0; // match inputs if this class comes on inputs with default margins
203
  @include font-size($input-font-size);
204
  line-height: $input-line-height;
205
  color: $input-plaintext-color;
206
  background-color: transparent;
207
  border: solid transparent;
208
  border-width: $input-border-width 0;
209
 
210
  .theme-dark & {
211
    color: $dm-input-plaintext-color;
212
  }
213
 
214
  &.form-control-sm,
215
  &.form-control-lg {
216
    padding-right: 0;
217
    padding-left: 0;
218
  }
219
}
220
 
221
 
222
// Form control sizing
223
//
224
// Build on `.form-control` with modifier classes to decrease or increase the
225
// height and font-size of form controls.
226
//
227
// Repeated in `_input_group.scss` to avoid Sass extend issues.
228
.form-control-lg {
229
  height: $input-height-lg;
230
  padding: $input-padding-y-lg $input-padding-x-lg;
231
  @include font-size($input-font-size-lg);
232
  line-height: $input-line-height-lg;
233
  @include border-radius($input-border-radius-lg);
234
}
235
 
236
// stylelint-disable-next-line no-duplicate-selectors
237
select.form-control {
238
 
239
  &[size],
240
  &[multiple] {
241
    height: auto;
242
  }
243
}
244
 
245
textarea.form-control {
246
  width: 100%;
247
  height: auto;
248
}
249
 
250
.form-inline textarea.form-control {
251
  width: 100%;
252
}
253
 
254
// Form groups
255
//
256
// Designed to help with the organization and spacing of vertical forms. For
257
// horizontal forms, use the predefined grid classes.
258
 
259
.form-group {
260
  margin: .35rem 0;
261
  align-items: center;
262
  position: relative;
263
 
264
  label {
265
    font-size: $font-size-sm;
266
    font-weight: $font-weight-medium;
267
  }
268
}
269
 
270
.form-group-btns {
271
  display: inline-flex;
272
  gap: 10px;
273
  flex-wrap: wrap;
274
}
275
 
276
.form-text {
277
  display: block;
278
  margin-top: $form-text-margin-top;
279
}
280
 
281
 
282
// Form grid
283
//
284
// Special replacement for our grid system's `.row` for tighter form layouts.
285
 
286
.form-row {
287
  display: flex;
288
  flex-wrap: wrap;
289
  margin-right: -$form-grid-gutter-width * 0.5;
290
  margin-left: -$form-grid-gutter-width * 0.5;
291
 
292
  >.col,
293
  >[class*="col-"] {
294
    padding-right: $form-grid-gutter-width * 0.5;
295
    padding-left: $form-grid-gutter-width * 0.5;
296
  }
297
}
298
 
299
 
300
// Checkboxes and radios
301
//
302
// Indent the labels to position radios/checkboxes as hanging controls.
303
 
304
.form-check {
305
  position: relative;
306
  display: block;
307
  padding-left: $form-check-input-gutter;
308
}
309
 
310
.form-check+.form-group {
311
  margin-left: .75rem !important;
312
}
313
 
314
.form-check-input {
315
  position: relative;
316
  margin-top: $form-check-input-margin-y;
317
  margin-left: -$form-check-input-gutter;
318
 
319
  // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247
320
  &[disabled]~.form-check-label,
321
  &:disabled~.form-check-label {
322
    color: $text-muted;
323
 
324
    .theme-dark & {
325
      color: $dm-text-muted;
326
    }
327
  }
328
}
329
 
330
.form-check-label {
331
  margin-bottom: 0; // Override default `<label>` bottom margin
332
  font-weight: $font-weight-medium;
333
  font-size: $font-size-sm;
334
 
335
  label {
336
    padding: 2px;
337
  }
338
}
339
 
340
.form-check-inline {
341
  display: inline-flex;
342
  align-items: center;
343
  padding-left: 0; // Override base .form-check
344
  margin-right: $form-check-inline-margin-x;
345
 
346
  // Undo .form-check-input defaults and add some `margin-right`.
347
  .form-check-input {
348
    position: static;
349
    margin-top: 0;
350
    margin-right: $form-check-inline-input-margin-x;
351
    margin-left: 0;
352
    margin-bottom: 0;
353
  }
354
}
355
 
356
 
357
// Form validation
358
//
359
// Provide feedback to users when form field values are valid or invalid. Works
360
// primarily for client-side validation via scoped `:invalid` and `:valid`
361
// pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
362
// server side validation.
363
 
364
@each $state, $data in $form-validation-states {
365
  @include form-validation-state($state, map-get($data, color), map-get($data, icon));
366
}
367
 
368
// Inline forms
369
//
370
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
371
// forms begin stacked on extra small (mobile) devices and then go inline when
372
// viewports reach <768px.
373
//
374
// Requires wrapping inputs and labels with `.form-group` for proper display of
375
// default HTML form controls and our custom form controls (e.g., input groups).
376
 
377
.form-inline {
378
  display: flex;
379
  flex-flow: row wrap;
380
  align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
381
 
382
  // Because we use flex, the initial sizing of checkboxes is collapsed and
383
  // doesn't occupy the full-width (which is what we want for xs grid tier),
384
  // so we force that here.
385
  .form-check {
386
    width: 100%;
387
  }
388
 
389
  select,
390
  input {
391
    margin-right: 0.25rem;
392
  }
393
 
394
  +h2 {
395
    margin-top: 2rem;
396
  }
397
 
398
  // Kick in the inline
399
  @include media-breakpoint-up(sm) {
400
    label {
401
      display: flex;
402
      align-items: center;
403
      justify-content: flex-start;
404
      margin-bottom: 0;
405
 
406
      font-weight: $font-weight-medium;
407
    }
408
 
409
    // Inline-block all the things for "inline"
410
    .form-group {
411
      display: flex;
412
      flex: 0 0 auto;
413
      flex-flow: row wrap;
414
      align-items: center;
415
      margin-bottom: 0;
416
    }
417
 
418
    // Allow folks to *not* use `.form-group`
419
    .form-control {
420
      display: inline-block;
421
      width: auto; // Prevent labels from stacking above inputs in `.form-group`
422
      vertical-align: middle;
423
 
424
      &[data-fieldtype="autocomplete"] {
425
        width: 100%;
426
      }
427
    }
428
 
429
    // Make static controls behave like regular ones
430
    .form-control-plaintext {
431
      display: inline-block;
432
    }
433
 
434
    .input-group,
435
    .custom-select {
436
      width: auto;
437
    }
438
 
439
    .custom-select {
440
      width: auto;
441
      max-width: 260px;
442
    }
443
 
444
    // Remove default margin on radios/checkboxes that were used for stacking, and
445
    // then undo the floating of radios and checkboxes to match.
446
    .form-check {
447
      display: flex;
448
      align-items: center;
449
      justify-content: flex-start;
450
      width: auto;
451
      padding-left: 0;
452
    }
453
 
454
    .form-check-input {
455
      position: relative;
456
      flex-shrink: 0;
457
      margin-top: 0;
458
      margin-right: $form-check-input-margin-x;
459
      margin-left: 0;
460
    }
461
 
462
    .custom-control {
463
      align-items: center;
464
      justify-content: center;
465
      line-height: 1.2;
466
    }
467
 
468
    .custom-switch {
469
      line-height: 1.6;
470
    }
471
 
472
    .custom-control-label {
473
      margin-bottom: 0;
474
    }
475
  }
476
}
477
 
478
 
479
/* THEME */
480
 
481
.checkbox {
482
  .form-check {
483
    width: calc(100% - 50px);
484
    padding: 0;
485
    margin: 0;
486
 
487
    align-items: center;
488
    display: inline-flex;
489
 
490
    font-size: $font-size-sm;
491
 
492
    .btn-link {
493
      margin-left: 0.5rem;
494
    }
495
 
496
    label {
497
      display: inline-flex;
498
      align-items: center;
499
      margin: 0;
500
 
501
      a {
502
        margin: 0 10px;
503
        color: $link-color;
504
 
505
        .theme-dark & {
506
          color: $dm-link-color;
507
        }
508
      }
509
    }
510
  }
511
}
512
 
513
 
514
// Contact form page
515
#page-user-contactsitesupport {
516
  .mform {
517
    .form-control {
518
      width: 100%;
519
    }
520
  }
521
}
522
 
523
[data-passwordunmaskid="id_quizpassword"] {
524
  width: 100%;
525
  display: inline-flex;
526
  align-items: center;
527
 
528
  .form-control {
529
    width: 260px !important;
530
  }
531
 
532
  [data-passwordunmask="unmask"] {
533
    background-color: $gray-100;
534
    margin: 0 5px;
535
    width: 30px;
536
    height: 30px;
537
    border-radius: $btn-border-radius-lg;
538
 
539
    display: flex;
540
    align-items: center;
541
    justify-content: center;
542
 
543
    .theme-dark & {
544
      background-color: $dm-gray-100;
545
    }
546
  }
547
}
548
 
549
[data-fieldtype="passwordunmask"] img {
550
  .theme-dark & {
551
    filter: invert(1);
552
  }
553
}
554
 
555
.mform>.form-group {
556
  margin: 20px 0 0 0;
557
}
558
 
559
.fdate_time_selector {
560
  .custom-control {
561
    width: 100%;
562
    margin: 5px 0;
563
  }
564
}