Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/* some very targetted corrections to roll back nameclashes between
2
 * Moodle and Bootstrap like .row, .label, .content, .controls
3
 *
4
 * Mostly relies on these styles being more specific than the Bootstrap
5
 * ones in order to overule them.
6
 */
7
 
8
// .label vs .label
9
 
10
.file-picker td.label {
11
    background: transparent;
12
    color: inherit;
13
    border: inherit;
14
    text-shadow: none;
15
    padding: 8px;
16
    white-space: normal;
17
    display: block;
18
    font-size: inherit;
19
    line-height: inherit;
20
    text-align: inherit;
21
}
22
 
23
.file-picker td.label {
24
    display: table-cell;
25
    text-align: right;
26
}
27
 
28
// Some of this dialog is sized in ems so a different font size
29
// effects the whole layout.
30
.choosercontainer #chooseform .option label {
31
    font-size: 12px;
32
}
33
 
34
/* block.invisible vs .invisible
35
 * block.hidden vs .invisible
36
 *
37
 * uses .invisible where the rest of Moodle uses @mixin dimmed
38
 * fixible in block renderer?
39
 *
40
 * There's seems to be even more naming confusion here since,
41
 * blocks can be actually 'visible' (or not) to students,
42
 * marked 'visible' but really just dimmed to indicate to editors
43
 * that students can't see them or  'visible' to the user who
44
 * collapses them, 'visible' if you have the right role and in
45
 * different circumstances different sections of a block can
46
 * be 'visible' or not.
47
 *
48
 * currently worked around in renderers.php function block{}
49
 * by rewriting the class name "invisible" to "dimmed",
50
 * though the blocks don't look particularly different apart
51
 * from their contents disappearing. Maybe try .muted? or
52
 * dimming all the edit icons apart from unhide, might be a
53
 * nice effect, though they'd still be active. Maybe reverse
54
 * it to white?
55
 */
56
 
57
li.section.hidden,
58
.block.hidden,
59
.block.invisible {
60
    visibility: visible;
61
    display: block;
62
}
63
 
64
 
65
/* .row vs .row
66
 *
67
 * very tricky to track down this when it goes wrong,
68
 * since the styles are applied to generated content
69
 *
70
 * basically if you see things shifted left or right compared
71
 * with where they should be check for a .row
72
 */
73
 
74
.forum-post .row {
75
    margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
76
}
77
 
78
.forum-post .row:before,
79
.forum-post .row:after {
80
    content: none;
81
}
82
/* fieldset.hidden vs .hidden
83
 *
84
 * Moodle uses fieldset.hidden for mforms, to signify a collection of
85
 * form elements that don't have a box drawn round them. Bootstrap
86
 * uses hidden for stuff that is hidden in various responsive modes.
87
 *
88
 * Relatedly, there is also fieldset.invisiblefieldset which hides the
89
 * border and sets the display to inline.
90
 *
91
 * Originally this just set block and visible, but it is used
92
 * in random question dialogue in Quiz,
93
 * that dialogue is hidden and shown, so when hidden the
94
 * above workaround leaves you with a button floating around
95
 */
96
 
97
fieldset.hidden {
98
    display: inherit;
99
    visibility: inherit;
100
}
101
 
102
/* .container vs .container
103
 *
104
 * bootstrap uses .container to set the width of the layout at 960px or so, Moodle uses it
105
 * in the Quiz to contain the questions to add. If you don't overule the Bootstrap code,
106
 * it becomes near unuseable.
107
 */
108
 
109
#questionbank + .container {
110
    width: auto;
111
}
112
 
113
// Allow the custom menu to expand/collapse when the user hovers over it with JS disabled.
114
body:not(.jsenabled) .dropdown:hover > .dropdown-menu {
115
    display: block;
116
    margin-top: -6px; // We need to move it up to counter the arrows as they introduce hover bugs.
117
}
118
 
119
// Enable scroll in the language menu.
120
body:not(.jsenabled) .langmenu:hover > .dropdown-menu,
121
.langmenu.open > .dropdown-menu {
122
    display: block;
123
    max-height: 150px;
124
    overflow-y: auto;
125
}
126
 
127
// Set menus in the fixed header to scroll vertically when they are longer than the page.
128
.rui-topbar.fixed-top .dropdown .dropdown-menu {
129
    max-height: calc(100vh - #{$navbar-height});
130
    overflow-y: auto;
131
}
132
 
133
// Dont allow z-index creep anywhere.
134
.page-item {
135
    &.active .page-link {
136
        @include plain-hover-focus {
137
            z-index: inherit;
138
        }
139
    }
140
}
141
/* Force positioning of popover arrows.
142
 *
143
 * The Css prefixer used in Moodle does not support complex calc statements used
144
 * in Bootstrap 4 CSS. For example:
145
 * calc((0.5rem + 1px) * -1); is stripped out by lib/php-css-parser/Parser.php.
146
 * See MDL-61879. For now the arrow positions of popovers are fixed until this is resolved.
147
 */
148
.bs-popover-right .arrow,
149
.bs-popover-auto[x-placement^="right"] .arrow {
150
    left: -9px;
151
}
152
.bs-popover-left .arrow,
153
.bs-popover-auto[x-placement^="left"] .arrow {
154
    right: -9px;
155
}
156
.bs-popover-top .arrow,
157
.bs-popover-auto[x-placement^="top"] .arrow {
158
    bottom: -9px;
159
}
160
.bs-popover-bottom .arrow,
161
.bs-popover-auto[x-placement^="bottom"] .arrow {
162
    top: -9px;
163
}
164
 
165
// Fixes an issue on Safari when the .custom-select is inside a .card class.
166
.custom-select {
167
    word-wrap: normal;
168
}
169
 
170
/* Add commented out carousel transistions back in.
171
 *
172
 * The Css prefixer used in Moodle breaks on @supports syntax, See MDL-61515.
173
 */
174
.carousel-item-next.carousel-item-left,
175
.carousel-item-prev.carousel-item-right {
176
    transform: translateX(0);
177
}
178
.carousel-item-next,
179
.active.carousel-item-right {
180
    transform: translateX(100%);
181
}
182
.carousel-item-prev,
183
.active.carousel-item-left {
184
    transform: translateX(-100%);
185
}
186
 
187
/**
188
 * Reset all of the forced style on the page.
189
 * - Remove borders on header and content.
190
 * - Remove most of the vertical padding.
191
 * - Make the content region flex grow so it pushes things like the
192
 *   next activity selector to the bottom of the page.
193
 */
194
$allow-reset-style: true !default;
195
 
196
@if $allow-reset-style {
197
    body.reset-style {
198
        .page-header-content {
199
            .card {
200
                border: none;
201
 
202
                .page-header-headings {
203
                    h1 {
204
                        margin-bottom: 0;
205
                    }
206
                }
207
 
208
                .card-body {
209
                    @include media-breakpoint-between(xs,sm) {
210
                        padding-left: 0;
211
                        padding-right: 0;
212
                    }
213
                }
214
            }
215
 
216
            & > div {
217
                padding-top: 0 !important;  /* stylelint-disable-line declaration-no-important */
218
                padding-bottom: 0 !important;  /* stylelint-disable-line declaration-no-important */
219
            }
220
        }
221
 
222
        #page-content {
223
            padding-bottom: 0 !important;  /* stylelint-disable-line declaration-no-important */
224
 
225
            #region-main-box {
226
                #region-main {
227
                    border: none;
228
                    display: inline-flex;
229
                    flex-direction: column;
230
                    padding: 0;
231
                    height: 100%;
232
                    width: 100%;
233
                    padding-left: $card-spacer-x;
234
                    padding-right: $card-spacer-x;
235
                    vertical-align: top;
236
 
237
                    div[role="main"] {
238
                        flex: 1 0 auto;
239
                    }
240
 
241
                    .activity-navigation {
242
                        overflow: hidden;
243
                    }
244
 
245
                    &.has-blocks {
246
                        width: calc(100% - #{$blocks-plus-gutter});
247
 
248
                        @include media-breakpoint-down(lg) {
249
                            width: 100%;
250
                        }
251
                    }
252
 
253
                    @include media-breakpoint-between(xs,sm) {
254
                        padding-left: 0;
255
                        padding-right: 0;
256
                    }
257
                }
258
 
259
                [data-region="blocks-column"] {
260
                    margin-left: auto;
261
                }
262
 
263
                @include media-breakpoint-down(lg) {
264
                    display: flex;
265
                    flex-direction: column;
266
                }
267
            }
268
        }
269
 
270
        select,
271
        input,
272
        textarea,
273
        .btn:not(.btn-icon) {
274
            border-radius: $btn-border-radius-lg;
275
        }
276
    }
277
}