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