fuzzyworld-tools / files / server / site-blog / blog.css
blog.css
0e603cf7 2026-10-31 Pavel Safronov | 1 | /* Styles for the blog (writing.fuzzyworld.net). Loaded after _shared.css, which supplies the color, |
| 2 | spacing and type tokens and the dark mode. A reading column, no frills. */ | |
| 3 | ||
| 4 | /* Same look as code.fuzzyworld.net (see site/style.css): a gray bar with the brand and an underlined current page, | |
| 5 | a 72rem frame, left-aligned; running text is held to a reading width inside it. */ | |
| 6 | body { margin: 0; font: 16px/1.65 var(--font-family-sans); } | |
| 7 | a { color: var(--color-accent); text-decoration: none; } | |
| 8 | a:hover { text-decoration: underline; } | |
| 9 | ||
| 10 | header.site { background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border-primary); } | |
| 11 | header.site .bar, footer.site .cols, main { max-width: 72rem; margin: 0 auto; padding-left: var(--spacing-md); padding-right: var(--spacing-md); box-sizing: border-box; } | |
| 12 | header.site .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--spacing-lg); } | |
| 13 | header.site .brand { font-weight: var(--font-weight-bold); font-size: var(--font-size-lg); color: var(--color-fg-primary); | |
| 14 | padding: var(--spacing-sm) 0; letter-spacing: -0.01em; } | |
| 15 | header.site .brand:hover { text-decoration: none; color: var(--color-accent); } | |
| 16 | header.site .brand::before { content: ""; display: inline-block; width: 1.1em; height: 1.1em; margin-right: 0.3em; vertical-align: -0.1em; | |
| 17 | background: url("/favicon.ico") center / contain no-repeat; } | |
| 18 | header.site .tagline { color: var(--color-fg-muted); } | |
7e1f4430 2026-11-01 Pavel Safronov | 19 | /* The blog's own bar under the site-wide one (config "site"). */ |
| 20 | header.site .bar.sub { border-top: 1px solid var(--color-border-primary); } | |
| 21 | header.site .bar.sub .title { font-weight: var(--font-weight-semibold); color: var(--color-fg-primary); padding: var(--spacing-xs) 0; } | |
| 22 | header.site .bar.sub .title:hover { text-decoration: none; color: var(--color-accent); } | |
| 23 | header.site .bar.sub .site-nav a { padding-top: var(--spacing-xs); padding-bottom: calc(var(--spacing-xs) - 2px); font-size: var(--font-size-sm); } | |
0e603cf7 2026-10-31 Pavel Safronov | 24 | .site-nav { display: flex; flex-wrap: wrap; gap: 0 var(--spacing-md); } |
| 25 | .site-nav a { color: var(--color-fg-muted); padding: var(--spacing-sm) 0 calc(var(--spacing-sm) - 2px); border-bottom: 2px solid transparent; } | |
| 26 | .site-nav a:hover { color: var(--color-fg-primary); text-decoration: none; } | |
| 27 | .site-nav a[aria-current] { color: var(--color-fg-primary); font-weight: var(--font-weight-semibold); border-bottom-color: var(--color-accent); } | |
| 28 | ||
| 29 | main { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-xl); } | |
| 30 | main > * { max-width: 46rem; } | |
| 31 | footer.site { margin-top: var(--spacing-xl); border-top: 1px solid var(--color-border-primary); background: var(--color-bg-secondary); | |
| 32 | color: var(--color-fg-muted); font-size: var(--font-size-sm); } | |
| 33 | footer.site .cols { padding-top: var(--spacing-md); padding-bottom: var(--spacing-lg); } | |
| 34 | footer.site p { margin: var(--spacing-xs) 0; } | |
d62e3357 2026-11-01 Pavel Safronov | 35 | /* The site-wide footer columns (gen.site_footer), same look as on fuzzyworld.net; the blog's own line sits under them. */ |
| 36 | footer.site .cols:has(> div) { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--spacing-lg); padding-top: var(--spacing-lg); } | |
| 37 | footer.site h2 { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-fg-muted); margin: 0 0 var(--spacing-xs); } | |
| 38 | footer.site .cols > div a, footer.site .cols > div span { display: block; padding: var(--spacing-xs) 0; } | |
| 39 | footer.site .legal { padding-top: 0; } | |
0e603cf7 2026-10-31 Pavel Safronov | 40 | |
| 41 | /* Plain lists: room for the numbers and bullets, which sit outside the list box (the reset in _shared.css | |
| 42 | removes all list padding). Same fix as on code.fuzzyworld.net. */ | |
| 43 | main ul:not([class]), main ol:not([class]) { padding-left: 1.75em; margin: 0 0 var(--spacing-md); } | |
| 44 | main ul:not([class]) li + li, main ol:not([class]) li + li { margin-top: 0.25em; } | |
| 45 | ||
| 46 | main h1 { font-size: var(--font-size-2xl); line-height: var(--line-height-tight); margin: 0 0 var(--spacing-sm); } | |
| 47 | main h2 { margin-top: var(--spacing-2xl); } | |
| 48 | main h3 { margin-top: var(--spacing-xl); color: var(--color-fg-secondary); font-size: var(--font-size-lg); } | |
| 49 | .meta { color: var(--color-fg-secondary); font-size: var(--font-size-sm); margin: 0 0 var(--spacing-lg); } | |
| 50 | .tag { display: inline-block; padding: 0 var(--spacing-sm); border: 1px solid var(--color-border-primary); border-radius: 1em; text-decoration: none; } | |
| 51 | .years { display: flex; flex-wrap: wrap; gap: var(--spacing-md); } | |
| 52 | ||
| 53 | .post-body img, .post-body video { max-width: 100%; height: auto; } | |
| 54 | .post-body blockquote { margin: var(--spacing-md) 0; padding-left: var(--spacing-md); border-left: 3px solid var(--color-border-secondary); color: var(--color-fg-secondary); } | |
| 55 | .post-body table { border-collapse: collapse; } | |
| 56 | .post-body th, .post-body td { border: 1px solid var(--color-border-primary); padding: var(--spacing-xs) var(--spacing-sm); } | |
| 57 | /* From the WordPress "Custom CSS" of the old site: single line breaks in the source do not show (the text runs on, as in | |
| 58 | WordPress), a scene break (---) is three centered dots, chapter headings are underlined. The <br> stays in the HTML. */ | |
| 59 | .post-body br, .excerpt br { display: none; } | |
| 60 | .post-body hr { border: 0; height: auto; margin: var(--spacing-lg) 0; text-align: center; } | |
| 61 | .post-body hr::after { content: "\B7\B7\B7"; font-size: 2rem; line-height: 1; letter-spacing: 0.4em; margin-left: 0.4em; color: var(--color-fg-muted); } | |
| 62 | .post-body h3, .entry .excerpt h5.chapter { text-decoration: underline; } | |
| 63 | pre { overflow-x: auto; padding: var(--spacing-md); background: var(--color-bg-secondary); border-radius: 6px; } | |
| 64 | ||
| 65 | .entry { margin: var(--spacing-md) 0 var(--spacing-lg); } | |
| 66 | .entry h4 { margin: 0; font-size: var(--font-size-lg); } | |
| 67 | .entry .meta { margin: 0; } | |
| 68 | .entry .excerpt { margin: var(--spacing-xs) 0 0; } | |
| 69 | .entry .excerpt p { margin: 0 0 var(--spacing-sm); } | |
| 70 | .entry .excerpt h5.chapter { margin: var(--spacing-md) 0 var(--spacing-xs); font-size: var(--font-size-base, 1rem); color: var(--color-fg-secondary); } | |
| 71 | .entry .more { margin: 0; } | |
| 72 | ||
| 73 | .comments-section { margin-top: var(--spacing-2xl); } | |
| 74 | ul.comments { list-style: none; padding: 0; } | |
| 75 | ul.comments ul.comments { margin-left: var(--spacing-lg); padding-left: var(--spacing-md); border-left: 2px solid var(--color-border-primary); } | |
| 76 | .comment { margin: var(--spacing-md) 0; } | |
| 77 | .comment p { margin: 0 0 var(--spacing-xs); } | |
e9fdc5db 2026-11-01 Pavel Safronov | 78 | .comment-form label { display: block; } |
| 79 | .comment-form input[type=text], .comment-form textarea { box-sizing: border-box; width: 100%; max-width: 40rem; padding: var(--spacing-xs) var(--spacing-sm); | |
| 80 | font: inherit; color: var(--color-fg-primary); background: var(--color-bg-secondary); border: 1px solid var(--color-border-primary); border-radius: 6px; } | |
| 81 | .comment-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; } | |
0e603cf7 2026-10-31 Pavel Safronov | 82 | |
| 83 | /* Code colors: the token classes gen.py's highlighter writes. */ | |
| 84 | .hl .c { color: var(--color-hl-comment); font-style: italic; } | |
| 85 | .hl .cp, .hl .k { color: var(--color-hl-keyword); } | |
| 86 | .hl .s { color: var(--color-hl-string); } | |
| 87 | .hl .m, .hl .nb, .hl .na { color: var(--color-hl-number); } | |
| 88 | .hl .nf, .hl .nd { color: var(--color-hl-function); } | |
| 89 | .hl .nc { color: var(--color-hl-class); } | |
| 90 | .hl .nt { color: var(--color-hl-type); } | |
| 91 | .hl .gi { color: var(--color-success); } | |
| 92 | .hl .gd { color: var(--color-error); } | |
| 93 | .hl .gh { font-weight: var(--font-weight-bold); } | |
| 94 | ||
| 95 | /* Light/dark switch (button added by blog.js) and reading progress bar. The color tokens for a chosen theme are | |
| 96 | appended to this file at build time from _shared.css (blog.py: theme_overrides). */ | |
| 97 | .theme-toggle { margin-left: auto; padding: var(--spacing-xs) var(--spacing-sm); font-size: var(--font-size-lg); line-height: 1; cursor: pointer; | |
| 98 | background: none; border: 1px solid var(--color-border-primary); border-radius: 6px; color: var(--color-fg-muted); } | |
| 99 | .theme-toggle:hover { color: var(--color-fg-primary); border-color: var(--color-border-secondary); } | |
| 100 | .progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--color-accent); z-index: 10; pointer-events: none; } |