mirror of
https://github.com/tiennm99/tsuki.git
synced 2026-05-23 10:25:30 +00:00
e19bb67c88
- 9 CSS files (tokens, reset, typography, layout, components, home, archive, toc, view-transitions) bundled via resources.Concat - 3 ES module JS files (theme-toggle, code-copy, toc-active); toc-active loaded only on long posts - @view-transition: navigation auto for cross-page morph (CSS-only) - TOC partial gated by WordCount>400 and Params.toc!=false; sticky on wide viewports, framed block on narrow - render-heading.html adds cosmetic anchor links - Hugo asset pipeline: resources.Concat | minify | fingerprint (no SCSS, no PostCSS, no Node) - i18n/vi.yml extended with prev/next/posts/archiveEmpty/toggleTheme - Bundle sizes: CSS 3.3 KB gz (budget 15), JS 0.8 KB gz (budget 8) Config: github-ascii heading IDs, :contentbasename permalink token for clean ASCII URLs, pagination.pagerSize migration (Hugo 0.128+).
68 lines
1.7 KiB
CSS
68 lines
1.7 KiB
CSS
/* tsuki: table of contents — sticky on wide, collapsible on narrow */
|
|
|
|
.toc {
|
|
font-size: var(--tsuki-fs-sm);
|
|
color: var(--tsuki-fg-muted);
|
|
}
|
|
.toc-heading {
|
|
font-size: var(--tsuki-fs-sm);
|
|
font-weight: 600;
|
|
margin: 0 0 var(--tsuki-space-3);
|
|
color: var(--tsuki-fg);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
.toc nav ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
.toc nav ul ul {
|
|
padding-inline-start: var(--tsuki-space-3);
|
|
margin-block-start: var(--tsuki-space-1);
|
|
}
|
|
.toc nav li { margin-block: var(--tsuki-space-1); }
|
|
.toc nav a {
|
|
display: block;
|
|
padding: 0.125rem 0;
|
|
color: var(--tsuki-fg-muted);
|
|
border-inline-start: 2px solid transparent;
|
|
padding-inline-start: var(--tsuki-space-3);
|
|
margin-inline-start: calc(-1 * var(--tsuki-space-3));
|
|
transition: var(--tsuki-transition);
|
|
}
|
|
.toc nav a:hover { color: var(--tsuki-fg); text-decoration: none; }
|
|
.toc nav a[aria-current="true"] {
|
|
color: var(--tsuki-accent);
|
|
border-inline-start-color: var(--tsuki-accent);
|
|
font-weight: 550;
|
|
}
|
|
|
|
/* wide layout: 2-col grid with sticky toc */
|
|
@media (min-width: 64rem) {
|
|
body.post main {
|
|
max-width: var(--tsuki-wide-width);
|
|
display: grid;
|
|
grid-template-columns: 1fr 14rem;
|
|
gap: var(--tsuki-space-12);
|
|
align-items: start;
|
|
}
|
|
body.post .post { min-width: 0; }
|
|
body.post .toc {
|
|
position: sticky;
|
|
inset-block-start: var(--tsuki-space-6);
|
|
max-block-size: calc(100vh - var(--tsuki-space-12));
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
|
|
/* narrow: framed block above content */
|
|
@media (max-width: 63.99rem) {
|
|
.toc {
|
|
margin-block-end: var(--tsuki-space-8);
|
|
padding: var(--tsuki-space-4);
|
|
border: 1px solid var(--tsuki-border);
|
|
border-radius: var(--tsuki-radius);
|
|
}
|
|
}
|