Skip to content

Commit e96a827

Browse files
committed
Move TOC to the right, if possible
See git#2036 (comment) Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e0bd9a7 commit e96a827

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

assets/sass/reference.scss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,17 @@ h3.plumbing {
215215

216216
// New inline TOC box styles
217217
.toc-box {
218+
position: fixed;
219+
left: calc(940px + 5px + (100vw - 940px)/2);
220+
max-height: calc(100vh - 150px);
221+
overflow: scroll;
222+
top: 124px;
218223
float: right;
219-
width: 200px;
220-
margin: 0 0 15px 20px;
224+
width: 160px;
225+
margin: 0;
221226
padding: 10px 12px;
222227
font-size: 13px;
223-
background-color: var(--callout-color);
228+
background-color: var(--main-bg);
224229
border: 1px solid var(--base-border-color);
225230
@include border-radius(3px);
226231

@@ -266,8 +271,22 @@ h3.plumbing {
266271
}
267272

268273
// Stack TOC box full-width on small screens
274+
@media (max-width: $default + 380px) {
275+
.toc-box {
276+
position: inherit;
277+
left: inherit;
278+
top: inherit;
279+
width: 200px;
280+
margin: 0 0 15px 20px;
281+
background-color: var(--callout-color);
282+
}
283+
}
284+
269285
@media (max-width: $mobile-m) {
270286
.toc-box {
287+
position: relative;
288+
left: inherit;
289+
top: inherit;
271290
float: none;
272291
width: 80%;
273292
max-width: none;

0 commit comments

Comments
 (0)