Update 0.2.0 reader UX and MDHelper docs

This commit is contained in:
shenw
2026-06-18 12:30:37 +08:00
parent 63a07b00b8
commit 2f480e7c8f
29 changed files with 1499 additions and 7954 deletions
+205 -1
View File
@@ -22,7 +22,7 @@ html[data-theme="dark"] body {
.reader {
box-sizing: border-box;
max-width: 980px;
max-width: var(--reader-paper-width);
min-height: 100vh;
margin: 0 auto;
padding: 34px 42px 56px;
@@ -32,6 +32,201 @@ html[data-theme="dark"] body {
html[data-theme="dark"] .reader {
background: #20242c;
}
.reader-shell {
box-sizing: border-box;
width: 100%;
min-height: 100vh;
}
.reader-shell.has-reader-toc {
display: grid;
grid-template-columns: minmax(0, var(--reader-paper-width)) minmax(190px, 240px);
gap: 24px;
justify-content: center;
align-items: start;
padding: 0 24px;
}
.reader-shell.has-reader-toc .reader {
grid-column: 1;
grid-row: 1;
width: 100%;
margin: 0;
}
.reader-toc {
box-sizing: border-box;
grid-column: 2;
grid-row: 1;
position: sticky;
top: 18px;
max-height: calc(100vh - 36px);
margin: 24px 0;
padding: 14px 10px 16px;
overflow: auto;
border: 1px solid #d9dee7;
border-radius: 8px;
background: rgba(255, 255, 255, 0.92);
box-shadow: 0 8px 24px rgba(22, 34, 51, 0.08);
}
.reader-toc__title {
margin: 0 6px 10px;
color: #526071;
font-size: 0.82em;
font-weight: 700;
}
.reader-toc__nav {
display: grid;
gap: 2px;
}
.reader-toc__link {
display: block;
min-height: 24px;
padding: 4px 8px;
border-radius: 6px;
color: #415064;
font-size: 0.86em;
line-height: 1.35;
text-decoration: none;
}
.reader-toc__link:hover {
background: #eef4fb;
text-decoration: none;
}
.reader-toc__link.is-active {
background: #dbeafe;
color: #124a7c;
font-weight: 700;
}
.reader-toc__link--level-2 {
padding-left: 18px;
}
.reader-toc__link--level-3 {
padding-left: 30px;
}
.reader-toc__link--level-4,
.reader-toc__link--level-5,
.reader-toc__link--level-6 {
padding-left: 42px;
}
.reader-progress {
position: fixed;
right: 18px;
bottom: 16px;
z-index: 20;
display: flex;
align-items: center;
gap: 8px;
min-width: 128px;
padding: 7px 9px;
border: 1px solid #d3dbe7;
border-radius: 8px;
background: rgba(255, 255, 255, 0.9);
color: #384557;
box-shadow: 0 8px 22px rgba(22, 34, 51, 0.12);
font-size: 12px;
backdrop-filter: blur(8px);
}
.reader-progress__track {
flex: 1;
height: 5px;
overflow: hidden;
border-radius: 999px;
background: #d9e2ef;
}
.reader-progress__bar {
width: 0%;
height: 100%;
border-radius: inherit;
background: #3577b9;
}
.reader-progress__text {
min-width: 34px;
text-align: right;
font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .reader-toc {
border-color: #3a4352;
background: rgba(32, 36, 44, 0.92);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .reader-toc__title {
color: #aeb8c8;
}
html[data-theme="dark"] .reader-toc__link {
color: #c7d0de;
}
html[data-theme="dark"] .reader-toc__link:hover {
background: #2b3543;
}
html[data-theme="dark"] .reader-toc__link.is-active {
background: #1f4a73;
color: #f2f7ff;
}
html[data-theme="dark"] .reader-progress {
border-color: #3a4352;
background: rgba(32, 36, 44, 0.9);
color: #dce5f3;
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}
html[data-theme="dark"] .reader-progress__track {
background: #3b4656;
}
html[data-theme="dark"] .reader-progress__bar {
background: #6aa9e9;
}
@media (max-width: 1080px) {
.reader-shell.has-reader-toc {
display: block;
padding: 0;
}
.reader-shell.has-reader-toc .reader {
margin: 0 auto;
}
.reader-toc {
grid-column: auto;
grid-row: auto;
position: static;
max-width: var(--reader-paper-width);
max-height: 34vh;
margin: 16px auto 0;
}
}
@media (max-width: 720px) {
.reader-toc {
display: none;
}
.reader-progress {
right: 10px;
bottom: 10px;
min-width: 108px;
}
}
h1,
h2,
@@ -323,6 +518,8 @@ html[data-theme="dark"] td code {
}
.code-block {
content-visibility: auto;
contain-intrinsic-size: auto 360px;
position: relative;
margin: 1.2em 0;
border: 1px solid #d4d4d4;
@@ -596,6 +793,8 @@ html[data-theme="dark"] .plain-file-view {
.diagram-block,
.math-block {
content-visibility: auto;
contain-intrinsic-size: auto 320px;
margin: 1.2em 0;
border: 1px solid #d8dee8;
border-radius: 8px;
@@ -724,6 +923,8 @@ img {
}
.media-block {
content-visibility: auto;
contain-intrinsic-size: auto 420px;
margin: 1.25em 0;
}
@@ -920,3 +1121,6 @@ html[data-theme="dark"] hr {
padding: 24px 20px 42px;
}
}