Skip to content

Commit 751de9e

Browse files
committed
fix mobile rendering for website
1 parent be1cf9c commit 751de9e

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

internal/website/_layouts/default.html

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
body { font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; margin:0; background: var(--bg); color:#222; }
1515
a { color:#0366d6; text-decoration:none; }
1616
a:hover { text-decoration:underline; }
17-
header { display:flex; align-items:center; justify-content:space-between; padding:.75rem 1.5rem; background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20; }
17+
header { display:flex; align-items:center; justify-content:space-between; padding:.75rem 1.5rem; background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20; flex-wrap:wrap; }
1818
.right-tools { display:flex; align-items:center; gap:.75rem; }
1919
.search-inline { position:relative; }
2020
.search-inline input { padding:.4rem .6rem; border:1px solid #d0d7de; border-radius:4px; font-size:.85rem; width:160px; }
@@ -25,9 +25,10 @@
2525
body.dark a { color:#58a6ff; }
2626
body.dark pre { background:#161b22; border-color:#30363d; }
2727
body.dark .sidebar a:hover { background:#161b22; }
28-
.logo-link { display:flex; align-items:center; gap:.5rem; font-weight:600; color:#222; }
28+
.logo-link { display:flex; align-items:center; gap:.5rem; font-weight:600; color:#222; white-space:nowrap; }
2929
.logo-link img { height:36px; }
30-
header nav a { margin-left:1rem; font-weight:500; }
30+
header nav { display:flex; align-items:center; flex-wrap:wrap; }
31+
header nav a { margin-left:1rem; font-weight:500; white-space:nowrap; }
3132
.layout { display:flex; align-items:flex-start; max-width: 1400px; margin:0 auto; padding:0 1.25rem 4rem; }
3233
.sidebar { width:var(--sidebar-width); padding:1.25rem .75rem 2rem; border-right:1px solid var(--border); position:sticky; top:60px; max-height:calc(100vh - 60px); overflow:auto; font-size:.9rem; }
3334
.sidebar h4 { margin:1.2rem 0 .5rem; font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; color:#555; }
@@ -45,12 +46,30 @@
4546
img { max-width:100%; height:auto; }
4647
footer { max-width:1400px; margin:0 auto; padding:2rem 1.5rem; border-top:1px solid var(--border); font-size:.8rem; color:#555; }
4748
@media (max-width: 900px) {
48-
.layout { flex-direction:column; }
49-
.sidebar { position:relative; top:0; max-height:none; width:100%; border-right:none; border-bottom:1px solid var(--border); display:flex; flex-wrap:wrap; gap:.5rem; }
50-
.sidebar h4 { flex-basis:100%; }
51-
.sidebar ul { display:contents; }
52-
.sidebar li { flex:1 1 48%; }
53-
.content { padding:1.25rem 1rem; }
49+
header { padding:.5rem 1rem; }
50+
header nav a { margin-left:.5rem; font-size:.85rem; }
51+
.logo-link { font-size:1.1rem !important; }
52+
.logo-link img { height:28px; }
53+
.layout { flex-direction:column; padding:0 .75rem 2rem; }
54+
.sidebar { position:relative; top:0; max-height:none; width:100%; border-right:none; border-bottom:1px solid var(--border); padding:.75rem .5rem; }
55+
.sidebar h4 { font-size:.7rem; margin:.8rem 0 .4rem; }
56+
.sidebar ul { margin-bottom:.5rem; }
57+
.sidebar li { margin:.25rem 0; }
58+
.sidebar a { padding:.2rem .3rem; font-size:.85rem; }
59+
.content { padding:1rem .75rem; }
60+
.content h1 { font-size:1.75rem; }
61+
.content h2 { font-size:1.4rem; }
62+
.content h3 { font-size:1.15rem; }
63+
pre { padding:.6rem .7rem; font-size:.85rem; overflow-x:auto; }
64+
table { font-size:.85rem; overflow-x:auto; display:block; }
65+
footer { padding:1.5rem 1rem; font-size:.75rem; }
66+
}
67+
@media (max-width: 480px) {
68+
header nav a { font-size:.8rem; margin-left:.4rem; }
69+
.logo-link span { font-size:1rem !important; }
70+
.content { padding:.75rem .5rem; }
71+
.content h1 { font-size:1.5rem; }
72+
pre { font-size:.8rem; }
5473
}
5574
</style>
5675
</head>

0 commit comments

Comments
 (0)