Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// Embedded icons from Open Iconic.
2
// Released under MIT and copyright 2014 Waybury.
3
// https://useiconic.com/open
4
 
5
 
6
// Checkboxes and radios
7
//
8
// Base class takes care of all the key behavioral aspects.
9
 
10
.custom-control {
11
  position: relative;
12
  z-index: 1;
13
  display: block;
14
  min-width: 30px;
15
  min-height: 16px;
16
  line-height: 21px;
17
  padding-left: 8px;
18
  padding-right: 0;
19
  margin-right: 10px;
20
  print-color-adjust: exact; // Keep themed appearance for print
21
 
22
  // Mod Glossary
23
  .simplesearchform & {
24
    margin: 10px 16px;
25
  }
26
}
27
 
28
.custom-control--xs {
29
  .custom-control-label {
30
    font-size: 0.688rem;
31
    line-height: 2;
32
    color: $body-color-light;
33
 
34
    .theme-dark & {
35
      color: $dm-body-color-light;
36
    }
37
  }
38
}
39
 
40
.custom-control-inline {
41
  display: inline-flex;
42
  margin-right: $custom-control-spacer-x;
43
 
44
  input[type="radio"] {
45
    margin: 0;
46
  }
47
}
48
 
49
.custom-control-input {
50
  position: absolute;
51
  left: 0;
52
  z-index: -1; // Put the input behind the label so it doesn't overlay text
53
  width: $custom-control-indicator-size;
54
  height: ($font-size-base * $line-height-base + $custom-control-indicator-size) * 0.5;
55
  opacity: 0;
56
 
57
  &.custom-control-input--xs {
58
    width: 25px;
59
    height: 16px;
60
  }
61
 
62
  &:checked ~ .custom-control-label::before {
63
    color: $custom-control-indicator-checked-color;
64
    border-color: $custom-control-indicator-checked-color;
65
    background-color: rgba($custom-control-indicator-checked-color, .3);
66
    @include box-shadow($custom-control-indicator-checked-box-shadow);
67
  }
68
 
69
  &:focus ~ .custom-control-label::before {
70
    // the mixin is not used here to make sure there is feedback
71
    @if $enable-shadows {
72
      box-shadow: $input-box-shadow, $custom-control-indicator-focus-box-shadow;
73
    } @else {
74
      box-shadow: $custom-control-indicator-focus-box-shadow;
75
    }
76
  }
77
 
78
  &:focus:not(:checked) ~ .custom-control-label::before {
79
    border-color: $custom-control-indicator-focus-border-color;
80
  }
81
 
82
  &:not(:disabled):active ~ .custom-control-label::before {
83
    color: $custom-control-indicator-active-color;
84
    background-color: $custom-control-indicator-active-bg;
85
    border-color: $custom-control-indicator-active-border-color;
86
    @include box-shadow($custom-control-indicator-active-box-shadow);
87
  }
88
 
89
  // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
90
  &[disabled],
91
  &:disabled {
92
    ~ .custom-control-label {
93
      color: $custom-control-label-disabled-color;
94
 
95
      .theme-dark & {
96
        color: $dm-custom-control-label-disabled-color;
97
      }
98
 
99
      &::before {
100
        background-color: $custom-control-indicator-disabled-bg;
101
        border-color: $custom-control-indicator-disabled-bg;
102
 
103
        .theme-dark & {
104
          background-color: $dm-custom-control-indicator-disabled-bg;
105
          border-color: $dm-custom-control-indicator-disabled-bg;
106
        }
107
      }
108
    }
109
  }
110
}
111
 
112
// Custom control indicators
113
//
114
// Build the custom controls out of pseudo-elements.
115
 
116
.custom-control-label {
117
  position: relative;
118
  margin-bottom: 0;
119
  max-width: 280px;
120
  color: $custom-control-label-color;
121
  vertical-align: top;
122
  cursor: $custom-control-cursor;
123
  font-size: $font-size-sm;
124
 
125
  // Background-color and (when enabled) gradient
126
  &::before {
127
    position: absolute;
128
    top: 0;
129
    left: -30px;
130
    display: block;
131
    width: $custom-control-indicator-size;
132
    height: $custom-control-indicator-size;
133
    pointer-events: none;
134
    content: "";
135
    background-color: transparent;
136
    border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width;
137
    @include box-shadow($custom-control-indicator-box-shadow);
138
 
139
    .theme-dark & {
140
      border-color: $dm-custom-control-indicator-border-color;
141
    }
142
  }
143
 
144
  // Foreground (icon)
145
  &::after {
146
    position: absolute;
147
    top: 0;
148
    left: -30px;
149
    display: block;
150
    width: $custom-control-indicator-size;
151
    height: $custom-control-indicator-size;
152
    content: "";
153
    background: 50% / #{$custom-control-indicator-bg-size} no-repeat;
154
  }
155
}
156
 
157
.custom-switch.custom-control--xs .custom-control-label::after {
158
  width: 8px;
159
  height: 8px;
160
  top: 7px;
161
  left: -28px;
162
}
163
.custom-switch.custom-control--xs .custom-control-label::before {
164
  width: 22px;
165
  height: 16px;
166
  top: 3px;
167
  left: -32px;
168
}
169
 
170
.custom-switch .custom-control-input.custom-control-input--xs:checked ~ .custom-control-label::after {
171
  transform: translateX(6px);
172
}
173
 
174
.dir-rtl .custom-switch .custom-control-input.custom-control-input--xs:checked~.custom-control-label::after {
175
  transform: translateX(-6px);
176
}
177
 
178
.custom-switch.custom-control--xs {
179
  padding-left: 37px;
180
}
181
 
182
// Checkboxes
183
//
184
// Tweak just a few things for checkboxes.
185
 
186
.custom-checkbox {
187
  .custom-control-label::before {
188
    @include border-radius($custom-checkbox-indicator-border-radius);
189
  }
190
 
191
  .custom-control-input:checked ~ .custom-control-label {
192
    &::after {
193
      background-image: escape-svg($custom-checkbox-indicator-icon-checked);
194
    }
195
  }
196
 
197
  .custom-control-input:indeterminate ~ .custom-control-label {
198
    &::before {
199
      border-color: $custom-checkbox-indicator-indeterminate-border-color;
200
      @include gradient-bg($custom-checkbox-indicator-indeterminate-bg);
201
      @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
202
    }
203
    &::after {
204
      background-image: escape-svg($custom-checkbox-indicator-icon-indeterminate);
205
    }
206
  }
207
 
208
  .custom-control-input:disabled {
209
    &:checked ~ .custom-control-label::before {
210
      @include gradient-bg($custom-control-indicator-checked-disabled-bg);
211
 
212
      .theme-dark & {
213
        @include gradient-bg($dm-custom-control-indicator-checked-disabled-bg!important);
214
      }
215
    }
216
    &:indeterminate ~ .custom-control-label::before {
217
      @include gradient-bg($custom-control-indicator-checked-disabled-bg);
218
 
219
      .theme-dark & {
220
        @include gradient-bg($dm-custom-control-indicator-checked-disabled-bg!important);
221
      }
222
    }
223
  }
224
}
225
 
226
// Radios
227
//
228
// Tweak just a few things for radios.
229
 
230
.custom-radio {
231
  margin: 5px 0;
232
 
233
  .custom-control-label::before {
234
    // stylelint-disable-next-line property-disallowed-list
235
    border-radius: $custom-radio-indicator-border-radius;
236
  }
237
 
238
  .custom-control-input:checked ~ .custom-control-label {
239
    &::after {
240
      background-image: escape-svg($custom-radio-indicator-icon-checked);
241
    }
242
  }
243
 
244
  .custom-control-input:disabled {
245
    &:checked ~ .custom-control-label::before {
246
      @include gradient-bg($custom-control-indicator-checked-disabled-bg);
247
 
248
      .theme-dark & {
249
        @include gradient-bg($dm-custom-control-indicator-checked-disabled-bg);
250
      }
251
    }
252
  }
253
}
254
 
255
 
256
// switches
257
//
258
// Tweak a few things for switches
259
 
260
.custom-switch {
261
  padding-left: $custom-switch-width + $custom-control-gutter;
262
 
263
  .custom-control-input {
264
    width: 35px;
265
    height: 20px;
266
  }
267
 
268
  .custom-control-label {
269
    &::before {
270
      left: -($custom-switch-width + $custom-control-gutter);
271
      width: $custom-switch-width;
272
      pointer-events: all;
273
      // stylelint-disable-next-line property-disallowed-list
274
      border-radius: $custom-switch-indicator-border-radius;
275
    }
276
 
277
    &::after {
278
      top: calc(0.125rem + 2px);
279
      left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2);
280
      width: $custom-switch-indicator-size;
281
      height: $custom-switch-indicator-size;
282
      background-color: $custom-control-indicator-color;
283
      // stylelint-disable-next-line property-disallowed-list
284
      border-radius: $custom-switch-indicator-border-radius - 2px;
285
      @include transition(transform .15s ease-in-out, $custom-forms-transition);
286
    }
287
  }
288
 
289
  .custom-control-input:checked ~ .custom-control-label {
290
    &::after {
291
      background-color: $custom-control-indicator-bg;
292
      transform: translateX($custom-switch-width - $custom-control-indicator-size);
293
 
1441 ariadna 294
      #admin-disabletab1 &,
1 efrain 295
      #admin-closecustomalert &,
296
      #admin-hideforgotpassword &,
297
      #admin-hidecourseindexnav &,
298
      #admin-turnoffdashboardlink &,
299
      #admin-hidedetails &,
300
      [id^="admin-turnoffsidebar"] & {
301
        background-color: #f81212;
302
      }
303
    }
304
    &::before {
305
      background-color: $custom-control-indicator-checked-color;
306
 
1441 ariadna 307
      #admin-disabletab1 &,
1 efrain 308
      #admin-closecustomalert &,
309
      #admin-hideforgotpassword &,
310
      #admin-hidecourseindexnav &,
311
      #admin-turnoffdashboardlink &,
312
      #admin-hidedetails &,
313
      [id^="admin-turnoffsidebar"] & {
314
        background-color: #ffb7b7;
315
        border-color: #ffb7b7;
316
      }
317
    }
318
  }
319
 
320
  .custom-control-input:disabled {
321
    &:checked ~ .custom-control-label::before {
322
      @include gradient-bg($custom-control-indicator-checked-disabled-bg);
323
 
324
      .theme-dark & {
325
        @include gradient-bg($dm-custom-control-indicator-checked-disabled-bg);
326
      }
327
    }
328
 
329
    ~ .custom-control-label::after {
330
      background-color: $custom-control-label-disabled-color;
331
 
332
      .theme-dark & {
333
        background-color: $dm-custom-control-label-disabled-color;
334
      }
335
    }
336
 
337
    &:checked ~ .custom-control-label::after {
338
      background-color: $custom-control-indicator-checked-disabled-color;
339
    }
340
  }
341
 
342
  // Reset styles for feedbkack form
343
  #page-mod-feedback-print &,
344
  #feedback_complete_form & {
345
    width: auto;
346
 
347
    .custom-control-input {
348
      opacity: 1;
349
      z-index: 1;
350
    }
351
 
352
    .custom-control-label::before,
353
    .custom-control-label:after {
354
      display: none;
355
    }
356
  }
357
 
358
}
359
 
360
 
361
// Select
362
//
363
// Replaces the browser default select with a custom one, mostly pulled from
364
// https://primer.github.io/.
365
//
1441 ariadna 366
.form-select,
1 efrain 367
.custom-select,
368
select.quickgrade {
369
  display: inline-block;
370
  width: 100%;
371
  font-family: $custom-select-font-family;
372
  font-weight: $custom-select-font-weight;
373
  line-height: $custom-select-line-height;
374
  color: $custom-select-color;
375
  vertical-align: middle;
376
  background: $custom-select-bg $custom-select-background;
377
  border: $custom-select-border-width solid $custom-select-border-color;
378
  @include border-radius($custom-select-border-radius, 0);
379
  @include box-shadow($custom-select-box-shadow);
380
  appearance: none;
381
 
382
  @include media-breakpoint-up(md) {
383
    max-width: 220px;
384
    height: $custom-select-height;
385
    padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
386
 
387
    @include font-size($custom-select-font-size);
388
  }
389
 
390
  @include media-breakpoint-between(xs, sm) {
391
    padding: 9px 22px 9px 14px;
392
    font-size: $font-size-xs;
393
  }
394
 
395
  .modal .fdate_time_selector & {
396
    height: 36px;
397
    padding-top: 6px;
398
    padding-bottom: 6px;
399
    padding-left: 12px;
400
    padding-right: 22px;
401
 
402
    font-size: $font-size-xs;
403
  }
404
 
405
  .theme-dark & {
406
    color: $dm-custom-select-color;
407
    background: $dm-custom-select-bg $dm-custom-select-background;
408
    border-color: $dm-custom-select-border-color;
409
  }
410
 
411
  &:focus {
412
    border-color: $custom-select-focus-border-color;
413
    outline: 0;
414
    @if $enable-shadows {
415
      @include box-shadow($custom-select-box-shadow, $custom-select-focus-box-shadow);
416
    } @else {
417
      // Avoid using mixin so we can pass custom focus shadow properly
418
      box-shadow: $custom-select-focus-box-shadow;
419
    }
420
 
421
    &::-ms-value {
422
      // For visual consistency with other platforms/browsers,
423
      // suppress the default white text on blue background highlight given to
424
      // the selected option text when the (still closed) <select> receives focus
425
      // in IE and (under certain conditions) Edge.
426
      // See https://github.com/twbs/bootstrap/issues/19398.
427
      color: $input-color;
428
      background-color: $input-bg;
429
 
430
      .theme-dark & {
431
        color: $dm-input-color;
432
        background-color: $dm-input-bg;
433
      }
434
    }
435
  }
436
 
437
  &[multiple],
438
  &[size]:not([size="1"]) {
439
    height: auto;
440
    padding-right: $custom-select-padding-x;
441
    background-image: none;
442
  }
443
 
444
  &:disabled {
445
    color: $custom-select-disabled-color;
446
    background-color: $custom-select-disabled-bg;
447
 
448
    .theme-dark & {
449
      color: $dm-custom-select-disabled-color;
450
      background-color: $dm-custom-select-disabled-bg;
451
    }
452
  }
453
 
454
  // Hides the default caret in IE11
455
  &::-ms-expand {
456
    display: none;
457
  }
458
 
459
  // Remove outline from select box in FF
460
  &:-moz-focusring {
461
    color: transparent;
462
    text-shadow: 0 0 0 $custom-select-color;
463
  }
464
}
465
 
466
.custom-select-sm {
467
  height: 36px;
468
  padding-top: 5px;
469
  padding-bottom: 5px;
470
  padding-left: 1rem;
471
 
472
  font-size: $font-size-xs;
473
  @include font-size($custom-select-font-size-sm);
474
}
475
 
476
.custom-select-lg {
477
  height: $custom-select-height-lg;
478
  padding-top: $custom-select-padding-y-lg;
479
  padding-bottom: $custom-select-padding-y-lg;
480
  padding-left: $custom-select-padding-x-lg;
481
  @include font-size($custom-select-font-size-lg);
482
}
483
 
484
 
485
// File
486
//
487
// Custom file input.
488
 
489
.custom-file {
490
  position: relative;
491
  display: inline-block;
492
  width: 100%;
493
  height: $custom-file-height;
494
  margin-bottom: 0;
495
}
496
 
497
.custom-file-input {
498
  position: relative;
499
  z-index: 2;
500
  width: 100%;
501
  height: $custom-file-height;
502
  margin: 0;
503
  overflow: hidden;
504
  opacity: 0;
505
 
506
  &:focus ~ .custom-file-label {
507
    border-color: $custom-file-focus-border-color;
508
    box-shadow: $custom-file-focus-box-shadow;
509
 
510
    .theme-dark & {
511
      border-color: $dm-custom-file-focus-border-color;
512
    }
513
  }
514
 
515
  // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
516
  &[disabled] ~ .custom-file-label,
517
  &:disabled ~ .custom-file-label {
518
    background-color: $custom-file-disabled-bg;
519
 
520
    .theme-dark & {
521
      background-color: $dm-custom-file-disabled-bg;
522
    }
523
  }
524
 
525
  @each $lang, $value in $custom-file-text {
526
    &:lang(#{$lang}) ~ .custom-file-label::after {
527
      content: $value;
528
    }
529
  }
530
 
531
  ~ .custom-file-label[data-browse]::after {
532
    content: attr(data-browse);
533
  }
534
}
535
 
536
.custom-file-label {
537
  position: absolute;
538
  top: 0;
539
  right: 0;
540
  left: 0;
541
  z-index: 1;
542
  height: $custom-file-height;
543
  padding: $custom-file-padding-y $custom-file-padding-x;
544
  overflow: hidden;
545
  font-family: $custom-file-font-family;
546
  font-weight: $custom-file-font-weight;
547
  line-height: $custom-file-line-height;
548
  color: $custom-file-color;
549
  background-color: $custom-file-bg;
550
  border: $custom-file-border-width solid $custom-file-border-color;
551
  @include border-radius($custom-file-border-radius);
552
  @include box-shadow($custom-file-box-shadow);
553
 
554
  .theme-dark & {
555
    color: $dm-custom-file-color;
556
    background-color: $dm-custom-file-bg;
557
  }
558
 
559
  &::after {
560
    position: absolute;
561
    top: 0;
562
    right: 0;
563
    bottom: 0;
564
    z-index: 3;
565
    display: block;
566
    height: $custom-file-height-inner;
567
    padding: $custom-file-padding-y $custom-file-padding-x;
568
    line-height: $custom-file-line-height;
569
    color: $custom-file-button-color;
570
    content: "Browse";
571
    @include gradient-bg($custom-file-button-bg);
572
    border-left: inherit;
573
    @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
574
 
575
    .theme-dark & {color: $dm-custom-file-button-color;}
576
  }
577
}
578
 
579
// Range
580
//
581
// Style range inputs the same across browsers. Vendor-specific rules for pseudo
582
// elements cannot be mixed. As such, there are no shared styles for focus or
583
// active states on prefixed selectors.
584
 
585
.custom-range {
586
  width: 100%;
587
  height: add($custom-range-thumb-height, $custom-range-thumb-focus-box-shadow-width * 2);
588
  padding: 0; // Need to reset padding
589
  background-color: transparent;
590
  appearance: none;
591
 
592
  &:focus {
593
    outline: 0;
594
 
595
    // Pseudo-elements must be split across multiple rulesets to have an effect.
596
    // No box-shadow() mixin for focus accessibility.
597
    &::-webkit-slider-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
598
    &::-moz-range-thumb     { box-shadow: $custom-range-thumb-focus-box-shadow; }
599
    &::-ms-thumb            { box-shadow: $custom-range-thumb-focus-box-shadow; }
600
  }
601
 
602
  &::-moz-focus-outer {
603
    border: 0;
604
  }
605
 
606
  &::-webkit-slider-thumb {
607
    width: $custom-range-thumb-width;
608
    height: $custom-range-thumb-height;
609
    margin-top: ($custom-range-track-height - $custom-range-thumb-height) * 0.5; // Webkit specific
610
    @include gradient-bg($custom-range-thumb-bg);
611
    border: $custom-range-thumb-border;
612
    @include border-radius($custom-range-thumb-border-radius);
613
    @include box-shadow($custom-range-thumb-box-shadow);
614
    @include transition($custom-forms-transition);
615
    appearance: none;
616
 
617
    &:active {
618
      @include gradient-bg($custom-range-thumb-active-bg);
619
    }
620
  }
621
 
622
  &::-webkit-slider-runnable-track {
623
    width: $custom-range-track-width;
624
    height: $custom-range-track-height;
625
    color: transparent; // Why?
626
    cursor: $custom-range-track-cursor;
627
    background-color: $custom-range-track-bg;
628
    border-color: transparent;
629
    @include border-radius($custom-range-track-border-radius);
630
    @include box-shadow($custom-range-track-box-shadow);
631
 
632
    .theme-dark & {background-color: $dm-custom-range-track-bg;}
633
  }
634
 
635
  &::-moz-range-thumb {
636
    width: $custom-range-thumb-width;
637
    height: $custom-range-thumb-height;
638
    @include gradient-bg($custom-range-thumb-bg);
639
    border: $custom-range-thumb-border;
640
    @include border-radius($custom-range-thumb-border-radius);
641
    @include box-shadow($custom-range-thumb-box-shadow);
642
    @include transition($custom-forms-transition);
643
    appearance: none;
644
 
645
    &:active {
646
      @include gradient-bg($custom-range-thumb-active-bg);
647
    }
648
  }
649
 
650
  &::-moz-range-track {
651
    width: $custom-range-track-width;
652
    height: $custom-range-track-height;
653
    color: transparent;
654
    cursor: $custom-range-track-cursor;
655
    background-color: $custom-range-track-bg;
656
    border-color: transparent; // Firefox specific?
657
    @include border-radius($custom-range-track-border-radius);
658
    @include box-shadow($custom-range-track-box-shadow);
659
 
660
    .theme-dark & {
661
      background-color: $dm-custom-range-track-bg;
662
    }
663
  }
664
 
665
  &::-ms-thumb {
666
    width: $custom-range-thumb-width;
667
    height: $custom-range-thumb-height;
668
    margin-top: 0; // Edge specific
669
    margin-right: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
670
    margin-left: $custom-range-thumb-focus-box-shadow-width;  // Workaround that overflowed box-shadow is hidden.
671
    @include gradient-bg($custom-range-thumb-bg);
672
    border: $custom-range-thumb-border;
673
    @include border-radius($custom-range-thumb-border-radius);
674
    @include box-shadow($custom-range-thumb-box-shadow);
675
    @include transition($custom-forms-transition);
676
    appearance: none;
677
 
678
    &:active {
679
      @include gradient-bg($custom-range-thumb-active-bg);
680
    }
681
  }
682
 
683
  &::-ms-track {
684
    width: $custom-range-track-width;
685
    height: $custom-range-track-height;
686
    color: transparent;
687
    cursor: $custom-range-track-cursor;
688
    background-color: transparent;
689
    border-color: transparent;
690
    border-width: $custom-range-thumb-height * 0.5;
691
    @include box-shadow($custom-range-track-box-shadow);
692
  }
693
 
694
  &::-ms-fill-lower {
695
    background-color: $custom-range-track-bg;
696
    @include border-radius($custom-range-track-border-radius);
697
 
698
    .theme-dark & {background-color: $dm-custom-range-track-bg;}
699
  }
700
 
701
  &::-ms-fill-upper {
702
    margin-right: 15px; // arbitrary?
703
    background-color: $custom-range-track-bg;
704
    @include border-radius($custom-range-track-border-radius);
705
 
706
    .theme-dark & {background-color: $dm-custom-range-track-bg;}
707
  }
708
 
709
  &:disabled {
710
    &::-webkit-slider-thumb {
711
      background-color: $custom-range-thumb-disabled-bg;
712
 
713
      .theme-dark & {background-color: $dm-custom-range-thumb-disabled-bg;}
714
    }
715
 
716
    &::-webkit-slider-runnable-track {
717
      cursor: default;
718
    }
719
 
720
    &::-moz-range-thumb {
721
      background-color: $custom-range-thumb-disabled-bg;
722
 
723
      .theme-dark & {background-color: $dm-custom-range-thumb-disabled-bg;}
724
    }
725
 
726
    &::-moz-range-track {
727
      cursor: default;
728
    }
729
 
730
    &::-ms-thumb {
731
      background-color: $custom-range-thumb-disabled-bg;
732
 
733
      .theme-dark & {background-color: $dm-custom-range-thumb-disabled-bg;}
734
    }
735
  }
736
}
737
 
738
.custom-control-label::before,
739
.custom-file-label,
1441 ariadna 740
.form-select,
1 efrain 741
.custom-select {
742
  @include transition($custom-forms-transition);
743
}