Skip to content

Commit c5bae0a

Browse files
committed
Pin emails to one line, hide single-entry TOCs
Two small quality-of-life fixes noticed during a mobile review. ## Email addresses never wrap Auto-linked `<a href="mailto:...">` elements now carry `white-space: nowrap` via a global CSS rule. `sw@wintermeyer-consulting.de` is short enough that it fits on any viewport, so this just prevents the browser from breaking an address between the `@` and the domain (or worse, mid-TLD) when a paragraph happens to wrap at that point. Applies site-wide (header, body, footer, Kontakt button) since every email occurrence already ships as an `a[href^="mailto:"]` in the output. ## TOC with a single entry is removed Antora's default client-side TOC (`aside.toc`) removes itself when the page has no matching headings. It happily renders a one-item list though — just the one section title, which looks like dead weight on pages like `recipes/index` that only have `h1 + h2`. Tightened the check in `site.js` from `if (!s.length)` to `if (s.length < 2)`, so the aside (and the embedded mobile copy) is dropped unless the page has at least two anchors worth linking to. Verified in a 390px-wide iframe harness: `recipes/index.html` now has no TOC, `ash/index.html` (two `h2`s) keeps its TOC, and every mailto link reports `whiteSpace: nowrap` with no increased page scrollWidth.
1 parent 0bf970b commit c5bae0a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

ui-bundle/src/css/site.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ main.article > .content {
272272
@apply text-[#65a30d] underline decoration-[#65a30d]/40 underline-offset-[3px] hover:decoration-[#65a30d] dark:text-[#c8f55a] dark:decoration-[#c8f55a]/40 dark:hover:decoration-[#c8f55a];
273273
}
274274

275+
/* Email addresses never wrap mid-address, even if they push the line
276+
wrap point out. Applies globally (header, body, footer) so a mailto
277+
link always renders as one uninterrupted token. */
278+
a[href^="mailto:"] {
279+
white-space: nowrap;
280+
}
281+
275282
.doc a.anchor {
276283
@apply hidden;
277284
}

ui-bundle/src/js/site.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)