fix(web): rich markdown notes get block structure — paragraphs, quotes, lists, code
Tailwind preflight zeroes p/blockquote/list margins globally, so notes
rendered through renderNoteHtml collapsed flat: blank lines between
paragraphs vanished, blockquotes were indistinguishable from body text,
lists had no bullets/indent, code blocks had no padding. The parser was
always correct — the loss was CSS at the x-html display sites.
One shared scoped block (.note-rich, in @layer components so it
outranks base preflight): p+p margin-top, blockquote bar + indent +
secondary color, list markers + padding, pre/code padding + themed bg,
modest heading sizes, underlined links, table borders, em-based so it
scales with each site's text-xs/text-sm context. Applied at all three
display sites: reader notes-drawer rows (replaces the unused
reader-note-rich hook), the 📝 highlight note line, and the banner's
expanded body.
The regenerated _templ.go files also catch up two stale .templ changes
that had shipped without regeneration (the selection popover's Adjust
button, the banner delete ternary) — the Docker build regenerates at
image-build, so the served site always matched the sources.
Verified live (headless Chromium against the dev stack): .note-rich in
the served stylesheet; p+p computed marginTop 9.6px, blockquote 3px
solid border-left, ul disc + 22.4px indent, pre padded + themed bg.
This commit is contained in:
1 parent
ffe690691b
commit
bbecd1e5ec
6 files changed
+85
-10
No files matched your search
@@ -986,6 +986,81 @@
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 1px;
|
||||
}
|
||||
/* Markdown notes render through renderNoteHtml (markdown.ts) into
|
||||
x-html containers at three sites (reader notes-drawer rows, the 📝
|
||||
highlight note line, the banner's expanded body). Tailwind preflight
|
||||
zeroes p/blockquote/list margins globally, which flattened paragraphs
|
||||
single-spaced and left blockquotes/heads indistinguishable from body
|
||||
text — this block restores block structure. em-based so it scales
|
||||
with each site's text-xs/text-sm context. */
|
||||
.note-rich p {
|
||||
margin: 0;
|
||||
}
|
||||
.note-rich p + p {
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
.note-rich h1, .note-rich h2, .note-rich h3,
|
||||
.note-rich h4, .note-rich h5, .note-rich h6 {
|
||||
margin: 0.8em 0 0.4em;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.note-rich h1 { font-size: 1.25em; }
|
||||
.note-rich h2 { font-size: 1.15em; }
|
||||
.note-rich h3, .note-rich h4 { font-size: 1.05em; }
|
||||
.note-rich h5, .note-rich h6 { font-size: 1em; }
|
||||
.note-rich blockquote {
|
||||
margin: 0.6em 0;
|
||||
padding: 0.1em 0 0.1em 0.75em;
|
||||
border-left: 3px solid color-mix(in srgb, var(--text-secondary) 55%, transparent);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.note-rich ul, .note-rich ol {
|
||||
margin: 0.6em 0;
|
||||
padding-left: 1.4em;
|
||||
}
|
||||
.note-rich ul { list-style: disc; }
|
||||
.note-rich ol { list-style: decimal; }
|
||||
.note-rich li { margin: 0.15em 0; }
|
||||
.note-rich li + li { margin-top: 0.25em; }
|
||||
.note-rich li > p { margin: 0; }
|
||||
.note-rich pre {
|
||||
margin: 0.6em 0;
|
||||
padding: 0.6em 0.75em;
|
||||
overflow-x: auto;
|
||||
border-radius: 0.375rem;
|
||||
background-color: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
|
||||
}
|
||||
.note-rich pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.note-rich code {
|
||||
font-size: 0.9em;
|
||||
padding: 0.1em 0.3em;
|
||||
border-radius: 0.25rem;
|
||||
background-color: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
|
||||
}
|
||||
.note-rich a {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
.note-rich hr {
|
||||
margin: 0.8em 0;
|
||||
}
|
||||
.note-rich table {
|
||||
margin: 0.6em 0;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
.note-rich th, .note-rich td {
|
||||
border: 1px solid var(--border);
|
||||
padding: 0.25em 0.5em;
|
||||
text-align: left;
|
||||
}
|
||||
.note-rich th { font-weight: 600; }
|
||||
.reader-tabs {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--border);
|
||||
|
||||
Reference in new issue
Block a user