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
/**
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
 
1441 ariadna 47
// Override the default bootstrap form-select width.
48
.form-select {
1 efrain 49
    width: auto;
50
    max-width: 100%;
51
}
52
 
1441 ariadna 53
#jump-to-activity.form-select {
1 efrain 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
 
1441 ariadna 215
.availability-field img {
216
    width: 16px;
217
    height: 16px;
218
}
219
 
1 efrain 220
.availability-eye {
221
    clear: left;
222
    float: left;
223
}
224
.availability-inner,
225
.availability-plugincontrols {
226
    float: left;
227
    @include border-radius($card-border-radius);
228
    border: $card-border-width solid $card-border-color;
229
    padding: 1rem;
230
    margin-top: 0.5rem;
231
}
232
.availability-plugincontrols,
233
.availability-childlist .availability-inner {
234
    margin-left: .625rem;
235
}
236
.availability-field .availability-plugincontrols .availability-group select {
237
    max-width: 12rem;
238
}
239
 
240
/* Custom styles for autocomplete form element */
241
/* These styles reserve a standard amount of space in the DOM to avoid flicker when the original select element is replaced */
242
[data-fieldtype=autocomplete] select,
243
[data-fieldtype=tags] select,
244
.form-autocomplete-original-select {
245
    visibility: hidden;
246
    overflow: hidden;
247
    width: 15rem;
248
    height: 44px;
249
    margin: 0;
250
    padding: 0;
251
    border: 0;
252
    margin-top: $font-size-base * $line-height-base + $input-padding-y-sm;
253
    vertical-align: bottom;
254
}
255
.form-autocomplete-selection {
256
    margin: $input-padding-y-sm 0;
257
    // Padding top and bottom, plus mb-1 and the 100% lineheight.
258
    min-height: 2 * $input-padding-y-sm + 2 * $font-size-base;
259
}
260
 
261
.form-autocomplete-selection [role=option] {
262
    cursor: pointer;
263
    white-space: inherit;
264
    word-break: break-word;
265
    line-height: 1.4;
266
    text-align: left;
267
}
268
 
269
.form-autocomplete-suggestions {
270
    position: absolute;
271
    background-color: $forms-autocomplete-bg;
272
    border: $border-width solid $input-border-color;
273
    min-width: 206px;
274
    max-height: 20em;
275
    overflow: auto;
276
    margin: $dropdown-spacer 0 0;
277
    padding: $dropdown-padding-y 0;
278
    z-index: 3;
279
}
280
 
1441 ariadna 281
$form-select-disabled-color: $gray-600 !default;
282
$form-select-disabled-bg: $gray-200 !default;
283
 
1 efrain 284
.form-autocomplete-suggestions li {
285
    list-style-type: none;
286
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
287
    margin: 0;
288
    cursor: pointer;
289
    color: $body-color;
1441 ariadna 290
    word-break: normal;
291
    overflow-wrap: anywhere;
292
    white-space: normal;
1 efrain 293
    &:hover,
294
    &:focus,
295
    &[aria-selected="true"] {
296
        background-color: $dropdown-link-active-bg;
297
        color: $dropdown-link-active-color;
298
    }
299
    &[aria-disabled="true"] {
300
        pointer-events: none;
1441 ariadna 301
        color: $form-select-disabled-color;
302
        background-color: $form-select-disabled-bg;
1 efrain 303
    }
304
    &.suggestions-heading {
305
        pointer-events: none;
306
        font-weight: bold;
307
        color: $body-color;
308
        background-color: $body-bg;
309
        padding-left: calc(#{$dropdown-item-padding-x} / 2);
310
    }
311
    &::before {
312
        content: "\200B";
313
    }
314
}
315
 
316
.form-autocomplete-downarrow {
317
    color: $body-color;
318
    top: 0.2rem;
319
    right: 0.5rem;
320
    cursor: pointer;
321
    .loading-icon {
322
        position: absolute;
323
        top: 0;
324
        left: 0;
325
        background-color: $white;
326
    }
327
}
328
 
329
/** Undo some bootstrap things */
330
.form-autocomplete-selection + input.form-control {
331
    width: auto;
332
    display: inline-block;
333
    vertical-align: middle;
334
}
335
 
336
.form-autocomplete-selection [data-active-selection=true] {
337
    box-shadow: $input-btn-focus-box-shadow;
338
}
339
 
340
select.form-control {
341
    &[size],
342
    &[multiple] {
343
        padding-right: 0;
344
        option {
345
            width: fit-content;
346
        }
347
    }
348
}
349
 
350
/* Non-bootstrap selects with a size show their contents outside of the element.
351
 * Remove when we update to stable bootstrap 4. (MDL-56511) */
352
select[size],
353
select[multiple] {
354
    overflow: auto;
355
}
356
 
357
select[size="1"] {
358
    overflow: visible;
359
}
360
 
361
textarea[data-auto-rows] {
362
    overflow-x: hidden;
363
    resize: none;
364
}
365
 
366
/** Display elements under labels in vertical forms regardless of the screen size. */
367
.mform.full-width-labels {
368
    .fitem.row {
369
        margin-left: 0;
370
        margin-right: 0;
371
        & > .col-md-3,
372
        & > .col-md-9 {
373
            flex: 0 0 100%;
374
            max-width: 100%;
375
            width: inherit;
376
            padding-right: 0;
377
            padding-left: 0;
378
        }
379
        &.femptylabel > .col-md-3 {
380
            display: none;
381
        }
382
        .form-control {
383
            width: 100%;
384
        }
385
    }
386
}
387
 
388
.mform .col-form-label .form-label-addon {
389
    margin-left: 0.25rem;
390
}
391
 
392
@include media-breakpoint-up(sm) {
393
    .mform:not(.full-width-labels) .col-form-label .form-label-addon {
394
        margin-left: auto;
395
    }
396
}
397
 
398
[data-fieldtype="modgrade"] .fitem {
399
    padding-bottom: $input-padding-y;
400
}
401
 
402
// We dont' use the mixin because it's expensive.
403
[data-fieldtype="modgrade"] {
404
    background-color: $card-bg;
405
    @include border-radius($card-border-radius);
406
    border: $card-border-width solid $card-border-color;
407
    padding: $card-spacer-x;
408
    margin-left: $grid-gutter-width * 0.5;
409
    max-width: 30rem;
410
}
411
 
412
// Styles for the JS file types browser provided by the "filetypes" element.
413
[data-filetypesbrowserbody] {
414
    [aria-expanded="false"] > [role="group"],
415
    [aria-expanded="false"] [data-filetypesbrowserfeature="hideifcollapsed"],
416
    [aria-expanded="true"] [data-filetypesbrowserfeature="hideifexpanded"] {
417
        display: none;
418
    }
419
}
420
 
421
// The autocomplete popup needs a display:block container to correctly position to popup.
422
.felement[data-fieldtype="autocomplete"],
423
.felement[data-fieldtype="tags"] {
424
    display: block !important; /* stylelint-disable-line declaration-no-important */
1441 ariadna 425
    position: static;
1 efrain 426
}
427
 
428
// Show editor at 100% width by default.
429
[data-fieldtype="editor"] > div {
430
    flex-grow: 1;
431
}
432
 
433
@include media-breakpoint-up(md) {
434
    .mform fieldset .fcontainer.collapseable .col-form-label {
435
        padding-left: ($spacer * 2.5);
436
    }
437
}
438
 
439
.collapsemenu {
440
    .collapseall {
441
        display: block;
442
    }
443
 
444
    .expandall {
445
        display: none;
446
    }
447
 
448
    &.collapsed {
449
        .collapseall {
450
            display: none;
451
        }
452
 
453
        .expandall {
454
            display: block;
455
        }
456
    }
457
}
458
 
459
// Form inset on the left/right.
460
// Used to display an icon/button within the form control.
461
.input-group {
462
    &.form-inset {
463
        .form-inset-item {
464
            position: absolute;
465
            padding-top: calc(#{$input-padding-y} + #{$input-border-width});
466
            z-index: 3;
467
        }
468
 
469
        &.form-inset-left {
470
            .form-control {
471
                padding-left: $spacer * 1.5;
472
            }
473
        }
474
 
475
        &.form-inset-right {
476
            .form-control {
477
                padding-right: $spacer * 1.5;
478
            }
479
            .form-inset-item {
480
                right: 0;
481
            }
482
        }
483
    }
484
}
485
 
486
// For form elements aligned to the left with no padding (e.g. Completion conditions activity settings).
487
.form-check {
488
    &.left-indented {
489
        padding-left: 0;
490
    }
491
}
492
 
493
// Remove the margins that come with the icon.
494
.toggle-sensitive-btn .icon {
495
    margin-right: 0;
496
}
497
 
498
// Input group elements display border radius depending on the proximity of other elements.
499
// This corrects border radius of the input when 'small screen only' mode hides the toggle button.
500
@media (min-width: 576px) {
501
    .toggle-sensitive-wrapper.small-screens-only.input-group:not(.has-validation) > {
502
        .form-control:not(:last-child) {
503
            @include border-radius($input-border-radius);
504
        }
505
        .form-control-lg:not(:last-child) {
506
            @include border-radius($input-border-radius-lg);
507
        }
1441 ariadna 508
        .toggle-sensitive-btn {
1 efrain 509
            display: none;
510
        }
511
    }
512
}