From 77436398123904199400d3183478fd4e3ee7adb2 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Fri, 28 Aug 2026 19:26:51 +0000 Subject: [PATCH] =?UTF-8?q?List=20markers:=20balanced=20indent=20via=20a?= =?UTF-8?q?=20centered=20full-indent=20box=20(--list-indent),=20ordered-li?= =?UTF-8?q?st=20counters,=20task=20checkboxes=20seated=20as=20markers=20wi?= =?UTF-8?q?th=20label-wrapped=20toggle=20text,=20summer=20=E2=9A=9C?= =?UTF-8?q?=EF=B8=8F=20bullets.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/assets/pagerite.css | 67 ++++++++++++++++++++++++++------ pagerite/markdown.py | 4 +- pagerite/themes/nitro/theme.css | 3 +- pagerite/themes/purple/theme.css | 9 +++-- pagerite/themes/summer/theme.css | 7 ++-- 5 files changed, 68 insertions(+), 22 deletions(-) diff --git a/frontend/src/assets/pagerite.css b/frontend/src/assets/pagerite.css index 96f5d7c..31b2371 100644 --- a/frontend/src/assets/pagerite.css +++ b/frontend/src/assets/pagerite.css @@ -625,37 +625,82 @@ article * + h6 { } /* Lists: small diamond emoji markers โ€” blue ๐Ÿ”น on odd nesting levels, - orange ๐Ÿ”ธ on even. The marker occupies a 1em outdented box so wrapped - lines align. */ -article ul { + orange ๐Ÿ”ธ on even; ordered lists get muted counters (an explicit + [type] attribute keeps the browser's native markers). The marker box + spans the whole --list-indent (outdented from the text column, + centered), so the space on both sides of the glyph is equal whatever + its advance width โ€” emoji diamonds, chevrons, flowers, whatever a + theme swaps in. The box is em-sized so it tracks the local text size + (e.g. smaller in asides); a theme that shrinks the glyph via + font-size must widen the box by the inverse factor (see the purple + theme) to keep it spanning the indent. */ +article :is(ul, ol:not([type])) { list-style: none; - padding-inline-start: 1.8em; + padding-left: 0; + --list-indent: 2em; +} + +article :is(ul, ol:not([type])) > li { + padding-left: var(--list-indent); } article ul li::before { content: "๐Ÿ”น"; display: inline-block; - margin-left: -1.3em; - width: 1.3em; + margin-left: calc(-1 * var(--list-indent)); + width: var(--list-indent); + text-align: center; } article ul ul li::before { content: "๐Ÿ”ธ"; } -article ul ul ul li::before { - content: "๐Ÿ”น"; +article ol:not([type]) { + list-style: none; + counter-reset: item; +} + +article ol:not([type]) > li { + counter-increment: item; +} + +article ol:not([type]) > li::before { + content: counter(item) "."; + color: var(--muted); + display: inline-block; + margin-left: calc(-1 * var(--list-indent)); + width: var(--list-indent); + text-align: left; +} + +/* Task lists: real clickable checkboxes. The checkbox stands in for the + list marker โ€” taken out of flow, left-aligned in the indent box and + centered on the first line's middle, so the item text starts at the + same edge as every other list item's. */ +article .task-list-item { + position: relative; } -/* Task lists: real checkboxes (not emoji), clickable in the public page. */ article .task-list-item::before { content: none; } article .task-list-item-checkbox { + position: absolute; + left: 0; + top: calc(0.5lh - .15ex); + translate: 0 -50%; + font-size: inherit; + line-height: inherit; cursor: pointer; - margin-inline-end: 0.35em; - vertical-align: middle; +} + +/* The item text is a