Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */
2
$fixed-header-y: $navbar-height;
3
 
4
$drawer-width: 285px !default;
5
$drawer-left-width: 285px !default;
6
$drawer-right-width: 315px !default;
7
$drawer-padding-x: 20px !default;
8
$drawer-padding-y: 20px !default;
9
$drawer-offscreen-gutter: 20px !default;
10
$drawer-bg-color: $gray-100 !default;
11
$drawer-scroll-bg-track: $gray-100 !default;
12
$drawer-shadow-color: rgba(0, 0, 0, .25) !default;
13
 
14
:target,
15
:focus {
16
    scroll-margin-top: $fixed-header-y + 10px;
17
}
18
 
19
.pagelayout-embedded :target {
20
    padding-top: initial;
21
    margin-top: initial;
22
}
23
 
24
#nav-drawer.closed {
25
    left: -($drawer-width + $drawer-offscreen-gutter);
26
}
27
 
28
#nav-drawer[aria-hidden=true] .list-group-item {
29
    display: none;
30
}
31
 
32
/* Use a variable for the drawer background colors. */
33
$drawer-bg: darken($body-bg, 5%) !default;
34
 
35
[data-region="drawer"] {
36
    position: fixed;
37
    width: $drawer-width;
38
    top: $fixed-header-y;
39
    height: calc(100% - #{$navbar-height});
40
    overflow-y: auto;
41
    -webkit-overflow-scrolling: touch;
42
    z-index: $zindex-dropdown - 1;
43
    background-color: $drawer-bg;
44
    @include transition(right 0.5s ease, left 0.5s ease);
45
}
46
 
47
@include media-breakpoint-up(sm) {
48
    [data-region="drawer"] {
49
        padding: $drawer-padding-x $drawer-padding-y;
50
    }
51
    .jsenabled .popover-process-monitor,
52
    .jsenabled .btn-footer-popover,
53
    .jsenabled .btn-footer-communication {
54
        @include transition(0.2s);
55
    }
56
}
57
#nav-drawer {
58
    right: auto;
59
    left: 0;
60
 
61
    /* Override the z-indexes defined in bootstrap/_list-group.scss that
62
       lead to side effects on the user tours positioning. */
63
    .list-group-item-action.active,
64
    .list-group-item.active {
65
        z-index: inherit;
66
    }
67
    .list-group-item-action.active + .list-group-item,
68
    .list-group-item.active + .list-group-item {
69
        border-top: none;
70
    }
71
 
72
    .list-group {
73
        // Remove default list styling in nav menus.
74
        ul {
75
            list-style: none;
76
            padding: 0;
77
            margin: 0;
78
        }
79
        // Add margin to be consistent with `.list-group-item` spacing.
80
        li {
81
            margin-bottom: -1px;
82
        }
83
        li:last-child {
84
            margin-bottom: 0;
85
        }
86
    }
87
}
88
 
89
body.drawer-ease {
90
    @include transition(margin-left 0.5s ease, margin-right 0.5s ease);
91
}
92
 
93
body:not(.uses-drawers).drawer-open-left {
94
    @include media-breakpoint-up(md) {
95
        margin-left: $drawer-left-width;
96
    }
97
}
98
 
99
body.drawer-open-left #page.drawers {
100
    @include media-breakpoint-up(md) {
101
        margin-left: $drawer-left-width;
102
        padding-left: 1rem;
103
    }
104
}
105
 
106
body.drawer-open-right {
107
    @include media-breakpoint-up(md) {
108
        margin-right: $drawer-right-width;
109
    }
110
}
111
 
112
$right-drawer-width: 320px;
113
 
114
[data-region=right-hand-drawer] {
115
    display: flex;
116
    flex-direction: column;
117
    @include transition(right .2s ease-in-out);
118
 
119
    &.drawer {
120
        z-index: $zindex-sticky + 1;
121
        position: fixed;
122
        top: $navbar-height;
123
        right: 0;
124
        height: calc(100% - #{$navbar-height});
125
        width: $right-drawer-width;
126
        box-shadow: -2px 2px 4px $drawer-shadow-color;
127
        padding: 0;
128
        visibility: visible;
129
        opacity: 1;
130
    }
131
 
132
    &.hidden {
133
        display: block;
134
        right: $right-drawer-width * -1;
135
        // Turn off visibility so that nothing in the drawer can receive focus when
136
        // it is hidden.
137
        visibility: hidden;
138
        opacity: 0;
139
        // Delay visibility changes until after the slide right animation has completed.
140
        @include transition(right .2s ease-in-out, visibility 0s ease-in-out .2s, opacity 0s ease-in-out .2s);
141
    }
142
}
143
 
144
@include media-breakpoint-down(sm) {
145
    [data-region=right-hand-drawer] {
146
        &.drawer {
147
            top: 0;
148
            height: 100%;
149
            z-index: $zindex-fixed + 1;
150
        }
151
    }
152
    body.drawer-open-left,
153
    body.drawer-open-right {
154
        overflow: hidden;
155
    }
156
}
157
 
158
.dir-rtl {
159
    [data-region=right-hand-drawer] {
160
        box-shadow: 2px 2px 4px $drawer-shadow-color;
161
    }
162
}
163
 
164
@mixin drawer() {
165
    background-color: $drawer-bg-color;
166
    // Drawers has a z-index higher than the page content,
167
    // lower than the top navbar and the sticky footer,
168
    // and lower to the message drawer.
169
    z-index: $zindex-sticky - 5;
170
 
171
    @include media-breakpoint-down(md) {
172
        // In small screens the drawer goes over the top navbar with a modal with a backdrop effect.
173
        z-index: $zindex-fixed + 5;
174
    }
175
 
176
    position: fixed;
177
    height: 100vh;
178
    top: 0;
179
 
180
    &.not-initialized {
181
        display: none;
182
    }
183
}
184
 
185
@mixin drawertypes() {
186
    &.drawer-right {
187
        @include transition(right 0.2s ease, top 0.2s ease, bottom 0.2s ease, visibility 0.2s ease, transform 0.5s ease);
188
        width: $drawer-right-width;
189
        max-width: $drawer-right-width;
190
        right: calc(-#{$drawer-right-width} + -10px);
191
        visibility: hidden;
192
        @include box-shadow($box-shadow-drawer-right);
193
 
194
        &.show {
195
            right: 0;
196
            visibility: visible;
197
        }
198
 
199
        .drawertoggle {
200
            margin-left: auto;
201
            margin-right: 5px;
202
        }
203
    }
204
    &.drawer-left {
205
        @include transition(left 0.2s ease, top 0.2s ease, bottom 0.2s ease, visibility 0.2s ease);
206
        width: $drawer-left-width;
207
        max-width: $drawer-left-width;
208
        left: calc(-#{$drawer-left-width} + -10px);
209
        visibility: hidden;
210
        @include box-shadow($box-shadow-drawer-left);
211
 
212
        &.show {
213
            left: 0;
214
            visibility: visible;
215
        }
216
 
217
        .drawertoggle {
218
            margin-right: auto;
219
            margin-left: 5px;
220
        }
221
    }
222
    &.drawer-bottom {
223
        bottom: -110%;
224
        &.show {
225
            bottom: 0;
226
        }
227
    }
228
    &.drawer-primary {
229
        .drawertoggle {
230
            margin-right: 16px;
231
            margin-left: 5px;
232
        }
233
    }
234
}
235
 
236
.drawer {
237
    @include drawer();
238
    @include drawertypes();
239
}
240
 
241
@include media-breakpoint-up(lg) {
242
    .drawer {
243
 
244
        // Workaround to display the skip link elements from the blocks drawer infront of the navbar.
245
        // As the skip link is in a fixed position and z-index for this element is ignored
246
        // then it is hidden behind the top navbar.
247
        // The workaround is to actually give a z-index to the drawer so it appears in front of the
248
        // navbar (https://developer.mozilla.org/en-US/docs/Web/CSS/z-index).
249
        &#theme_boost-drawers-blocks:focus-within {
250
            z-index: $zindex-fixed + 1;
251
        }
252
 
253
        &.not-initialized {
254
            display: block;
255
        }
256
    }
257
}
258
 
259
.drawer-md,
260
.drawer-sm {
261
    display: none;
262
}
263
 
264
.drawerheader {
265
    padding: 0;
266
    height: $navbar-height;
267
    display: flex;
268
    align-items: center;
269
    .sitename {
270
        overflow: hidden;
271
        white-space: nowrap;
272
        text-overflow: ellipsis;
273
        margin-right: 16px;
274
    }
275
}
276
.drawer.scrolled .drawerheader {
277
    box-shadow: 0 8px 11px -7px $drawer-shadow-color;
278
}
279
 
280
@include media-breakpoint-down(md) {
281
    .drawer-md {
282
        display: block;
283
        @include drawer();
284
        @include drawertypes();
285
    }
286
}
287
 
288
@include media-breakpoint-down(sm) {
289
    .drawer-sm {
290
        display: block;
291
        @include drawer();
292
        @include drawertypes();
293
    }
294
}
295
 
296
.drawercontent {
297
    position: relative;
298
    z-index: -1;
299
    height: calc(100% - #{$navbar-height});
300
    display: flex;
301
    flex-direction: column;
302
    flex-wrap: nowrap;
303
    overflow-y: auto;
304
    padding: 0.4rem;
305
 
306
    .dropdown-menu .dropdown-item {
307
        width: 220px;
308
        white-space: normal;
309
    }
310
 
311
    @include thin-scrolls($drawer-scroll-bg-track);
312
}