Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/**
2
 * Moodle forms HTML isn't changeable via renderers (yet?) so this
3
 * .less file imports styles from the bootstrap $variables file and
4
 * adds them to the existing Moodle form CSS ids and classes.
5
 *
6
 */
7
 
8
.jsenabled .mform .containsadvancedelements .advanced {
9
    display: none;
10
}
11
 
12
.mform .containsadvancedelements .advanced.show {
13
    display: flex;
14
}
15
 
16
#adminsettings span.error {
17
    display: inline-block;
18
    border: 1px solid $state-danger-border;
19
    border-radius: 4px;
20
    background-color: $state-danger-bg;
21
    padding: 4px;
22
    margin-bottom: 4px;
23
}
24
 
25
.mform .d-flex {
26
    .fitem {
27
        margin: 0.1rem 0.25rem 0.1rem 0 !important; /* stylelint-disable-line declaration-no-important */
28
    }
29
    br + label {
30
        justify-content: flex-start;
31
        width: 100%;
32
        margin-right: 0;
33
    }
34
}
35
 
36
// Override the default bootstrap form-control width.
37
.d-flex {
38
    & > .form-control {
39
        width: auto;
40
        max-width: 100%;
41
    }
42
    & > textarea.form-control {
43
        width: 100%;
44
    }
45
}
46
 
47
// Override the default bootstrap custom-select width.
48
.custom-select {
49
    width: auto;
50
    max-width: 100%;
51
}
52
 
53
#jump-to-activity.custom-select {
54
    width: 100%;
55
}
56
 
57
.mform fieldset {
58
    margin-bottom: $spacer * 0.5;
59
    border-bottom: $border-width solid $table-border-color;
60
}
61
 
62
#adminsettings .form-control[size] {
63
    width: auto;
64
}
65
 
66
#adminsettings .error {
67
    color: $danger;
68
}
69
 
70
.mform ul.file-list {
71
    padding: 0;
72
    margin: 0;
73
    list-style: none;
74
}
75
 
76
.mform label .req,
77
.mform label .adv {
78
    cursor: help;
79
}
80
/*rtl:ignore*/
81
input#id_externalurl {
82
    direction: ltr;
83
}
84
 
85
#portfolio-add-button {
86
    display: inline;
87
}
88
 
89
.form-defaultinfo,
90
.form-label .form-shortname {
91
    color: $text-muted;
92
}
93
 
94
.form-label .form-shortname {
95
    font-size: $font-size-xs;
96
    display: block;
97
}
98
 
99
.formsettingheading .form-horizontal {
100
    color: $text-muted;
101
}
102
 
103
// Moodle doesn't differentiate between what Bootstrap calls
104
// .uneditable-inputs and form help text. Styling them both as
105
// uneditable looks ugly, styling both as form help is fairly
106
// subtle in it's impact. Going for the latter as the best option.
107
.no-felement.fstatic {
108
    color: $text-muted;
109
    padding-top: 5px;
110
}
111
 
112
.no-fitem .fstaticlabel {
113
    font-weight: bold;
114
}
115
 
116
.form-item .form-setting .defaultsnext > input {
117
    display: inline-block;
118
}
119
 
120
.form-item .form-setting .form-checkbox.defaultsnext {
121
    // Need to specify .defaultsnext and the .form-checkbox class
122
    // is somewhat randomly re-used on various actual checkboxes
123
    // throughout the admin forms, instead of on the wrapper div.
124
    margin-top: 5px; // Push down checkboxes to align.
125
    display: inline-block; // So above style sticks.
126
}
127
 
128
#adminsettings h3 {
129
    // Copied from bootstrap/forms.less tag legend.
130
    display: block;
131
    width: 100%;
132
    padding: 0;
133
    margin-bottom: $line-height-base;
134
    font-size: $font-size-lg;
135
    line-height: $line-height-base * 2;
136
    border: 0;
137
    border-bottom: 1px solid $forms-adminsettings-border-bottom-color;
138
}
139
 
140
// I think this could be avoided (or at least tidied up) ifr
141
// we used HTML5 input types like url, phone, email, number etc.
142
/* rtl:ignore */
143
.mform .fitem .felement input[name="email"],
144
.mform .fitem .felement input[name="email2"],
145
.mform .fitem .felement input[name="url"],
146
.mform .fitem .felement input[name="idnumber"],
147
.mform .fitem .felement input[name="phone1"],
148
.mform .fitem .felement input[name="phone2"] {
149
    text-align: left;
150
    direction: ltr;
151
}
152
 
153
// Reduce the mediaplugin width when using inside forms.
154
.que.match .mediaplugin {
155
    width: 50vw;
156
}
157
 
158
/* rtl:ignore */
159
#page-admin-grade-edit-scale-edit .error input#id_name {
160
    margin-right: 170px;
161
}
162
 
163
#page-grade-edit-outcome-course .courseoutcomes {
164
    margin-left: auto;
165
    margin-right: auto;
166
    width: 100%;
167
}
168
 
169
#page-grade-edit-outcome-course .courseoutcomes td {
170
    text-align: center;
171
}
172
/* Install Process' text fields Forms, should always be justified to the left */
173
/* rtl:ignore */
174
#installform #id_wwwroot,
175
#installform #id_dirroot,
176
#installform #id_dataroot,
177
#installform #id_dbhost,
178
#installform #id_dbname,
179
#installform #id_dbuser,
180
#installform #id_dbpass,
181
#installform #id_prefix {
182
    direction: ltr;
183
}
184
 
185
.mdl-right > label {
186
    // Workaround for repository pop-up because the : are outside the label,
187
    // can/should be fixed in filemanager renderers.
188
    display: inline-block;
189
}
190
 
191
.singleselect {
192
    max-width: 100%;
193
}
194
 
195
.form-item .form-label label {
196
    margin-bottom: 0;
197
}
198
 
199
div#dateselector-calendar-panel {
200
    z-index: 3100; /* Set higher than the z-index of the filemanager - see MDL-39047. */
201
}
202
 
203
/**
204
 * Show the labels above text editors and file managers except on wide screens.
205
 */
206
 
207
 
208
/* Section and module editing forms contain special JS components for the
209
   availability system (if enabled). */
210
#id_availabilityconditionsjson[aria-hidden=true],
211
.availability-field [aria-hidden=true] {
212
    display: none;
213
}
214
 
215
.availability-eye {
216
    clear: left;
217
    float: left;
218
}
219
.availability-inner,
220
.availability-plugincontrols {
221
    float: left;
222
    @include border-radius($card-border-radius);
223
    border: $card-border-width solid $card-border-color;
224
    padding: 1rem;
225
    margin-top: 0.5rem;
226
}
227
.availability-plugincontrols,
228
.availability-childlist .availability-inner {
229
    margin-left: .625rem;
230
}
231
.availability-field .availability-plugincontrols .availability-group select {
232
    max-width: 12rem;
233
}
234
 
235
/* Custom styles for autocomplete form element */
236
/* These styles reserve a standard amount of space in the DOM to avoid flicker when the original select element is replaced */
237
[data-fieldtype=autocomplete] select,
238
[data-fieldtype=tags] select,
239
.form-autocomplete-original-select {
240
    visibility: hidden;
241
    overflow: hidden;
242
    width: 15rem;
243
    height: 44px;
244
    margin: 0;
245
    padding: 0;
246
    border: 0;
247
    margin-top: $font-size-base * $line-height-base + $input-padding-y-sm;
248
    vertical-align: bottom;
249
}
250
.form-autocomplete-selection {
251
    margin: $input-padding-y-sm 0;
252
    // Padding top and bottom, plus mb-1 and the 100% lineheight.
253
    min-height: 2 * $input-padding-y-sm + 2 * $font-size-base;
254
}
255
 
256
.form-autocomplete-selection [role=option] {
257
    cursor: pointer;
258
    white-space: inherit;
259
    word-break: break-word;
260
    line-height: 1.4;
261
    text-align: left;
262
}
263
 
264
.form-autocomplete-suggestions {
265
    position: absolute;
266
    background-color: $forms-autocomplete-bg;
267
    border: $border-width solid $input-border-color;
268
    min-width: 206px;
269
    max-height: 20em;
270
    overflow: auto;
271
    margin: $dropdown-spacer 0 0;
272
    padding: $dropdown-padding-y 0;
273
    z-index: 3;
274
}
275
 
276
.form-autocomplete-suggestions li {
277
    list-style-type: none;
278
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
279
    margin: 0;
280
    cursor: pointer;
281
    color: $body-color;
282
    &:hover,
283
    &:focus,
284
    &[aria-selected="true"] {
285
        background-color: $dropdown-link-active-bg;
286
        color: $dropdown-link-active-color;
287
    }
288
    &[aria-disabled="true"] {
289
        pointer-events: none;
290
        color: $custom-select-disabled-color;
291
        background-color: $custom-select-disabled-bg;
292
    }
293
    &.suggestions-heading {
294
        pointer-events: none;
295
        font-weight: bold;
296
        color: $body-color;
297
        background-color: $body-bg;
298
        padding-left: calc(#{$dropdown-item-padding-x} / 2);
299
    }
300
    &::before {
301
        content: "\200B";
302
    }
303
}
304
 
305
.form-autocomplete-downarrow {
306
    color: $body-color;
307
    top: 0.2rem;
308
    right: 0.5rem;
309
    cursor: pointer;
310
    .loading-icon {
311
        position: absolute;
312
        top: 0;
313
        left: 0;
314
        background-color: $white;
315
    }
316
}
317
 
318
/** Undo some bootstrap things */
319
.form-autocomplete-selection + input.form-control {
320
    width: auto;
321
    display: inline-block;
322
    vertical-align: middle;
323
}
324
 
325
.form-autocomplete-selection [data-active-selection=true] {
326
    box-shadow: $input-btn-focus-box-shadow;
327
}
328
 
329
select.form-control {
330
    &[size],
331
    &[multiple] {
332
        padding-right: 0;
333
        option {
334
            width: fit-content;
335
        }
336
    }
337
}
338
 
339
/* Non-bootstrap selects with a size show their contents outside of the element.
340
 * Remove when we update to stable bootstrap 4. (MDL-56511) */
341
select[size],
342
select[multiple] {
343
    overflow: auto;
344
}
345
 
346
select[size="1"] {
347
    overflow: visible;
348
}
349
 
350
textarea[data-auto-rows] {
351
    overflow-x: hidden;
352
    resize: none;
353
}
354
 
355
/** Display elements under labels in vertical forms regardless of the screen size. */
356
.mform.full-width-labels {
357
    .fitem.row {
358
        margin-left: 0;
359
        margin-right: 0;
360
        & > .col-md-3,
361
        & > .col-md-9 {
362
            flex: 0 0 100%;
363
            max-width: 100%;
364
            width: inherit;
365
            padding-right: 0;
366
            padding-left: 0;
367
        }
368
        &.femptylabel > .col-md-3 {
369
            display: none;
370
        }
371
        .form-control {
372
            width: 100%;
373
        }
374
    }
375
}
376
 
377
.mform .col-form-label .form-label-addon {
378
    margin-left: 0.25rem;
379
}
380
 
381
@include media-breakpoint-up(sm) {
382
    .mform:not(.full-width-labels) .col-form-label .form-label-addon {
383
        margin-left: auto;
384
    }
385
}
386
 
387
[data-fieldtype="modgrade"] .fitem {
388
    padding-bottom: $input-padding-y;
389
}
390
 
391
// We dont' use the mixin because it's expensive.
392
[data-fieldtype="modgrade"] {
393
    background-color: $card-bg;
394
    @include border-radius($card-border-radius);
395
    border: $card-border-width solid $card-border-color;
396
    padding: $card-spacer-x;
397
    margin-left: $grid-gutter-width * 0.5;
398
    max-width: 30rem;
399
}
400
 
401
// Styles for the JS file types browser provided by the "filetypes" element.
402
[data-filetypesbrowserbody] {
403
    [aria-expanded="false"] > [role="group"],
404
    [aria-expanded="false"] [data-filetypesbrowserfeature="hideifcollapsed"],
405
    [aria-expanded="true"] [data-filetypesbrowserfeature="hideifexpanded"] {
406
        display: none;
407
    }
408
}
409
 
410
// The autocomplete popup needs a display:block container to correctly position to popup.
411
.felement[data-fieldtype="autocomplete"],
412
.felement[data-fieldtype="tags"] {
413
    display: block !important; /* stylelint-disable-line declaration-no-important */
414
}
415
 
416
// Show editor at 100% width by default.
417
[data-fieldtype="editor"] > div {
418
    flex-grow: 1;
419
}
420
 
421
@include media-breakpoint-up(md) {
422
    .mform fieldset .fcontainer.collapseable .col-form-label {
423
        padding-left: ($spacer * 2.5);
424
    }
425
}
426
 
427
.collapsemenu {
428
    .collapseall {
429
        display: block;
430
    }
431
 
432
    .expandall {
433
        display: none;
434
    }
435
 
436
    &.collapsed {
437
        .collapseall {
438
            display: none;
439
        }
440
 
441
        .expandall {
442
            display: block;
443
        }
444
    }
445
}
446
 
447
// Form inset on the left/right.
448
// Used to display an icon/button within the form control.
449
.input-group {
450
    &.form-inset {
451
        .form-inset-item {
452
            position: absolute;
453
            padding-top: calc(#{$input-padding-y} + #{$input-border-width});
454
            z-index: 3;
455
        }
456
 
457
        &.form-inset-left {
458
            .form-control {
459
                padding-left: $spacer * 1.5;
460
            }
461
        }
462
 
463
        &.form-inset-right {
464
            .form-control {
465
                padding-right: $spacer * 1.5;
466
            }
467
            .form-inset-item {
468
                right: 0;
469
            }
470
        }
471
    }
472
}
473
 
474
// For form elements aligned to the left with no padding (e.g. Completion conditions activity settings).
475
.form-check {
476
    &.left-indented {
477
        padding-left: 0;
478
    }
479
}
480
 
481
// Remove the margins that come with the icon.
482
.toggle-sensitive-btn .icon {
483
    margin-right: 0;
484
}
485
 
486
// Input group elements display border radius depending on the proximity of other elements.
487
// This corrects border radius of the input when 'small screen only' mode hides the toggle button.
488
@media (min-width: 576px) {
489
    .toggle-sensitive-wrapper.small-screens-only.input-group:not(.has-validation) > {
490
        .form-control:not(:last-child) {
491
            @include border-radius($input-border-radius);
492
        }
493
        .form-control-lg:not(:last-child) {
494
            @include border-radius($input-border-radius-lg);
495
        }
496
        .input-group-append .toggle-sensitive-btn {
497
            display: none;
498
        }
499
    }
500
}