Skip to content

Commit 260e49c

Browse files
committed
Compat with Safari and css improvements
1 parent 03a7b63 commit 260e49c

File tree

2 files changed

+40
-19
lines changed

2 files changed

+40
-19
lines changed

html/css/main.css

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ th {
199199
header {
200200
grid-area: header;
201201
text-align: right;
202+
position: -webkit-sticky;
202203
position: sticky;
203204
top: 0;
204205
z-index: 5;
@@ -236,9 +237,10 @@ header ul {
236237
background: var(--bkg-color);
237238
border-radius: 5px;
238239
position:absolute;
239-
right:20px;
240+
right:10px;
240241
max-width: 910px;
241242
width: 95%;
243+
box-shadow: 0px 5px 10px rgba(0,0,0,0.25);
242244
}
243245

244246
header ul:not(:empty) {
@@ -297,11 +299,13 @@ footer p {
297299
nav {
298300
grid-area: nav;
299301
padding-top: 20px;
300-
padding: 0 0 20px 20px;
302+
padding: 5px 0 20px 26px;
301303
font-size:0.9em;
304+
line-height: 1.4;
302305
}
303306
@media (min-width:768px) {
304307
nav {
308+
position: -webkit-sticky;
305309
position: sticky;
306310
top: 68px;
307311
overflow-y: auto;
@@ -314,26 +318,31 @@ nav {
314318
}
315319

316320
nav ul {
317-
padding-left: 20px;
318-
list-style: none;
319-
/*! margin: 0 0 0 15px; */
320321
padding: 0;
322+
padding-left: 0;
323+
list-style: none;
324+
margin:0;
321325
}
322326
nav > ul {
323-
margin-left: 0px;
327+
margin: 7px 0;
328+
margin-left: 0;
324329
}
325330

331+
332+
nav > ul > li > a,
326333
nav > ul > li > span > a{
327334
font-weight: 600;
328335
cursor: pointer;
336+
font-size: 13px;
329337
}
330338

331339
nav > ul > li > a {
332-
font-weight: bold;
340+
display:inline-block;
341+
padding: 5px 0;
333342
}
334343

335344
nav > ul > li {
336-
margin: 12px 0;
345+
margin: 0px 0;
337346
}
338347
nav ul li {
339348
padding: 0px 0;
@@ -343,7 +352,7 @@ nav ul li a {
343352
}
344353
nav ul li span {
345354
display: block;
346-
padding: 2px 5px 2px 15px;
355+
padding: 5px 5px 5px 15px;
347356
margin-left:-15px
348357
}
349358
nav ul li.active > span{
@@ -370,7 +379,7 @@ nav .expand > span {
370379
content: "";
371380
position: absolute;
372381
left: 3px;
373-
top:10px;
382+
top:12px;
374383
border: solid var(--text-color-control);
375384
border-width: 0 1px 1px 0;
376385
display: inline-block;
@@ -380,6 +389,7 @@ nav .expand > span {
380389
-webkit-transform: rotate(-45deg);
381390
}
382391
.expand.expand-on > span:after {
392+
top:11px;
383393
transform: rotate(45deg);
384394
-webkit-transform: rotate(45deg);
385395
}
@@ -392,8 +402,9 @@ nav .expand > span {
392402
aside {
393403
/*! grid-area: aside; */
394404
/*! padding-top: 20px; */
395-
padding: 0 20px 0 20px;
405+
padding: 0 10px 0 10px;
396406
font-size:0.85em;
407+
line-height: 1.4;
397408
}
398409
aside ul {
399410
padding-left: 20px;
@@ -402,30 +413,35 @@ aside ul {
402413
padding: 0;
403414
}
404415
aside > ul {
405-
margin-left: 0px;
416+
margin-left: 0px;
406417
}
407418

408419
@media (min-width:768px) {
409420
aside {
421+
position: -webkit-sticky;
410422
position: sticky;
411423
top: 68px;
412424
overflow-y: auto;
413425
min-width: 270px;
414426
height: calc(100vh - 68px);
415-
width: 320px;
427+
width: 310px;
416428
}
417429
aside > ul > li >ul {
418430
border-left: 1px solid var(--border-color);
419431

420432
}
421433
}
422434

435+
aside > ul > li >ul {
436+
margin-top: 5px;
437+
}
438+
423439
aside > ul > li > a{
424-
font-weight: 600;
440+
font-weight: 600;
425441
}
426442

427443
aside ul li {
428-
padding: 2px 0;
444+
padding: 5px 0;
429445
}
430446
aside ul li a {
431447
color: var(--text-color);
@@ -501,10 +517,13 @@ article h3:hover:before {
501517
}
502518

503519
.content {
504-
display: flex;
520+
display: grid;
505521
grid-area: content;
506522
min-width: 0;
507-
/*! justify-content: ; */
523+
/*! justify-content: space-around; */
524+
grid-template-areas: "article nav";
525+
grid-template-columns: 3fr 1fr;
526+
grid-template-rows: min-content 0fr;
508527
}
509528

510529
.search-match {
@@ -771,6 +790,7 @@ article :target:before {
771790
padding-top: 20px;
772791
padding-left: 30px;
773792
box-shadow: 2px 0 15px rgba(0,0,0,0.25);
793+
overflow-y: auto;
774794
min-width: 300px;
775795
max-width: 87dvw;
776796
}
@@ -779,7 +799,7 @@ article :target:before {
779799
article h2, article h3 { line-height: 1.2; word-break: break-all;}
780800
}
781801
@media (max-width:768px) {
782-
.content { flex-direction: column-reverse; }
802+
.content {display:flex; flex-direction: column-reverse; }
783803
aside {
784804
display:block;
785805
position:static;

html/template.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ window.onload = function() { init(); }
4444
window.addEventListener('DOMContentLoaded', () => {
4545
// Remove TOC panel and abort if there's nothing to track
4646
if (document.querySelector('aside ul ul') == null) {
47-
document.querySelector('aside')?.remove();
47+
const aside = document.querySelector('aside');
48+
if (aside) aside.remove();
4849
return;
4950
}
5051

0 commit comments

Comments
 (0)