From 09aa9bddba7cb2e934de3d61c5ea617cc110d621 Mon Sep 17 00:00:00 2001 From: Jason Burns Date: Sat, 27 Jun 2026 20:41:17 -0700 Subject: [PATCH] Clamp long titles to a few lines with full-title hover tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runaway headlines (e.g. the "He's sitting with his arms folded…" quote-lede ones) blew out the Latest grid: grid cards take their height from the tallest card in the row, so one giant title left huge uneven gaps and pushed cards into ragged rows. Clamp titles with -webkit-line-clamp (lead 4 lines, mini/card 3) and expose the full headline via a native title="" hover tooltip on each heading, using the existing escapeAttr() helper. Covers hero lead, hero side, grid, and the saved-search card. Co-Authored-By: Claude Opus 4.8 --- digest.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/digest.html b/digest.html index b5f9b42..92bb565 100644 --- a/digest.html +++ b/digest.html @@ -337,7 +337,9 @@ .lead { display: flex; flex-direction: column; } .lead .thumb { aspect-ratio: 16/9; margin-bottom: 15px; } .lead .kicker { margin-bottom: 10px; } - .lead-title { font-family: var(--font-head); font-weight: 700; font-size: 31px; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 11px; } + /* Clamp to a few lines so a runaway headline can't blow out the layout; + full title is on the element's native hover tooltip (title=""). */ + .lead-title { font-family: var(--font-head); font-weight: 700; font-size: 31px; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 11px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; } .lead:hover .lead-title { color: var(--brand); } .lead-summary { font-size: 15px; color: var(--text2); line-height: 1.55; max-width: 60ch; margin-bottom: 13px; } .lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; } @@ -346,7 +348,7 @@ .mini { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: start; } .mini .thumb { aspect-ratio: 1/1; } .mini .kicker { font-size: 10px; margin-bottom: 6px; } - .mini-title { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 7px; } + .mini-title { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 7px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } .mini:hover .mini-title { color: var(--brand); } .mini-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; } @@ -360,7 +362,7 @@ .card { display: flex; flex-direction: column; } .card .thumb { aspect-ratio: 16/10; margin-bottom: 13px; } .card .kicker { margin-bottom: 9px; } - .card-title { font-family: var(--font-head); font-weight: 600; font-size: 18.5px; line-height: 1.2; letter-spacing: -0.018em; margin-bottom: 8px; } + .card-title { font-family: var(--font-head); font-weight: 600; font-size: 18.5px; line-height: 1.2; letter-spacing: -0.018em; margin-bottom: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } .card:hover .card-title { color: var(--brand); } .card-summary { font-size: 13.5px; color: var(--text2); line-height: 1.5; margin-bottom: 11px; } .card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; } @@ -1789,7 +1791,7 @@
${thumbBlock(lead)} ${kicker(lead)} -

${openLink(lead, lead.title)}

+

${openLink(lead, lead.title)}

${lead.summary ? `

${lead.summary}

` : ''} ${clusterDisclosure(lead)}
${srcLine(lead)} ${cardActions(lead)}
@@ -1799,7 +1801,7 @@

${openLink(lead, lead.title)}

${thumbBlock(a)}
${kicker(a)} -

${openLink(a, a.title)}

+

${openLink(a, a.title)}

${clusterDisclosure(a)}
${srcLine(a)} ${cardActions(a)}
@@ -1812,7 +1814,7 @@

${openLink(a, a.title)}

${thumbBlock(a)} ${kicker(a)} -

${openLink(a, a.title)}

+

${openLink(a, a.title)}

${a.summary ? `

${a.summary}

` : ''} ${clusterDisclosure(a)}
${srcLine(a)} ${cardActions(a)}
@@ -1833,7 +1835,7 @@

${openLink(a, a.title)}

`;