/
_components.scss
345 lines (303 loc) · 7.38 KB
/
_components.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
//
.content {
.card:not(:last-child) {
margin-bottom: 1em;
}
kbd {
@extend .tag;
@extend .is-dark;
}
}
/* Font Awesome 5 mixin. Can be included in any rule that should render Font Awesome icons. */
@mixin font-awesome {
font-family: "Font Awesome 5 Free";
font-weight: 900;
}
// TODO: move to an earlier file?
/* */
h1, h2, h3, h4, h5, h6 {
.heading-anchor {
visibility: hidden;
vertical-align: middle;
margin-left: 0.5em;
font-size: 0.8rem;
&::before {
@include font-awesome;
content: "\f0c1";
}
}
&:hover .heading-anchor {
visibility: visible;
}
}
.docstring {
@extend .card;
margin-bottom: 1em;
> header {
@extend .card-header;
// background-color: $background;
// Same as .card-header-title, sans font-weight:
// align-items: center;
color: $card-header-color;
display: flex;
flex-grow: 1;
padding: $card-header-padding;
// padding: $card-header-padding $card-content-padding;
}
> section {
@extend .card-content;
border-bottom: 1px solid $border;
&:last-child {
border-bottom: none;
}
// TODO: FIX!
footer {
margin-top: 0.5rem;
text-align: right;
// float: right;
// position: relative;
// right: 0.7*$card-content-padding;
// top: 0.7*$card-content-padding;
// visibility: hidden;
> a {
@extend .tag;
@extend .is-light;
@extend .is-size-7;
}
}
&:hover > footer {
visibility: visible;
}
}
}
#main {
@include tablet {
padding: 0 1rem;
padding-left: 1.3rem;
}
// We need to
> * {
max-width: $documenter-max-width;
}
@include mobile {
> .content, > footer {
padding: 0 1rem;
}
}
}
// #navbar is the top bar of the page that contains the breadcrumb,
// the "Edit on GitHub" link and the sidebar burger (when on mobile).
#navbar {
background-color: $body-background-color;
border-bottom: 1px solid $border;
z-index: 2;
min-height: 4rem;
margin-bottom: 1rem;
display: flex;
.breadcrumb {
flex-grow: 1;
}
.right {
display: flex;
> * {
display: inline-block;
}
.edit-page {
white-space: nowrap;
margin: auto 0;
.edit-page-text {
@extend .is-hidden-mobile;
padding: 0;
}
}
.sidebar-button {
@extend .is-hidden-tablet;
font-size: 1.5rem;
margin: auto 0 auto 1rem;
}
}
> * {
margin: auto 0;
}
@include mobile {
// background-color: $background;
// box-shadow: 0.2rem 0rem 0.4rem #bbb;
position: sticky;
top: 0;
padding: 0 1rem;
/* For Headroom.js */
transition-property: top, box-shadow;
-webkit-transition-property: top, box-shadow; /* Safari */
transition-duration: 0.3s;
-webkit-transition-duration: 0.3s; /* Safari */
&.headroom--not-top {
box-shadow: $shadow-size 0rem $shadow-blur $shadow;
transition-duration: 0.7s;
-webkit-transition-duration: 0.7s; /* Safari */
}
&.headroom--unpinned.headroom--not-top.headroom--not-bottom {
top: -4.5rem;
transition-duration: 0.7s;
-webkit-transition-duration: 0.7s; /* Safari */
}
}
}
#sidebar {
@extend .dashboard-panel;
color: $sidebar-color;
background-color: $sidebar-background;
border-right: 1px solid $border;
padding: 0;
position: absolute;
left: -$sidebar-width;
width: $sidebar-width;
flex: 0 0 $sidebar-width;
z-index: 5;
transition: left 0.3s;
&.visible {
left: 0;
box-shadow: 2*$shadow-size 0rem 2*$shadow-blur $shadow;
@include tablet {
box-shadow: none;
}
}
@include tablet {
left: 0;
position: relative;
}
#pagetitle {
@extend .is-size-4;
// @include font-size($sidebar-title-font-size);
text-align: center;
white-space: nowrap;
overflow: hidden;
font-weight: $weight-bold;
/* The padding works around the problem that when you set overflow: hidden, part
* of the <h1> gets hidden away.
*/
padding: 0.5rem 0;
#pagetitle-overflow-box {
max-width: $sidebar-title-width;
transition: all 0.3s;
}
}
#sidebar-menu {
@extend .is-scrollable;
font-size: $size-normal;
> li > .tocitem {
padding-left: $sidebar-menu-padding;
}
ul > li > .tocitem {
padding-left: 2*$sidebar-menu-padding;
}
ul ul > li > .tocitem {
padding-left: 3*$sidebar-menu-padding;
}
ul ul ul li > .tocitem {
padding-left: 4*$sidebar-menu-padding;
}
.tocitem {
display: block;
padding-top: 0.4em;
padding-bottom: 0.4em;
&, &:hover {
color: $sidebar-color;
}
}
a.tocitem:hover {
background-color: $sidebar-menu-hover-background;
// color: $sidebar-menu-hover-color;
}
.tocitem.is-active {
border-top: 1px solid $sidebar-menu-border;
&, &:hover {
background-color: $sidebar-menu-active-background;
color: $sidebar-menu-active-color;
font-weight: $sidebar-menu-active-font-weight;
}
}
ul.internal {
background-color: $sidebar-menu-internal-background;
border-top: 1px solid $sidebar-menu-internal-border;
border-bottom: 1px solid $sidebar-menu-internal-border;
& .tocitem:hover {
background-color: $sidebar-menu-internal-hover-background;
}
}
/* Setting up a nicer theme style for the scrollbar */
overflow-y: auto;
-webkit-overflow-scroll: touch;
&::-webkit-scrollbar {
width: .3rem;
background: none;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px 0px 0px 5px;
background: $sidebar-scrollbar-color;
}
&::-webkit-scrollbar-thumb:hover {
background: $sidebar-scrollbar-color-hover;
}
}
#version-selector {
@extend .select;
@extend .is-rounded;
@extend .is-small;
> select {
width: 0.4 * $sidebar-width;
text-align: center;
text-align-last: center;
}
}
#search-form {
> input {
@extend .input;
@extend .is-rounded;
@extend .is-small;
width: 0.8 * $sidebar-width;
}
margin: auto;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
}
// .ui-mask {
// transition: opacity 0.3s;
// opacity: 0;
// // display: none;
// background-color: black;
//
// visibility: hidden;
// position: absolute;
// min-width: 100vw;
// min-height: 100vh;
// z-index: 4;
//
// &.visible {
// opacity: 0.3;
// // display: block;
// visibility: visible;
// }
// }
// Bulma always adds a vertical scrollbar to the whole page. But since we're using the
// dashboard with the panes being scrollable individually, we need to explicitly remove the
// scrollbars from the html element.
html {
overflow-x: hidden;
overflow-y: hidden;
}
// There appears to be a rendering bug in Chrome, where elements with `position: absolute` in
// an overflow container affect whether the outer container is overflowing / needs
// scrollbars.
//
// In this particular case, KaTeX applies `position: absolute` on the the MathML
// accessibility span. This breaks the dashboard layout of the equation is somewhere far
// down in the container.
//
// Moving all of these accessbility "pixels" to the top-right seems to take care of the
// issue. An alternative is also to use `position: fixed`, which does not cause the outer
// container to scroll.
.katex .katex-mathml {
top: 0;
right: 0;
}