mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 07:39:07 +03:00
Loosen headline leading for 2-line headlines
1.1 line-height reads fine for a single line but felt cramped once a headline wraps to two lines. Added a lineHeightTwoLine token (1.2), applied only when fit.lineCount === 2 — single-line and 3-line headlines are unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9895ff051
commit
db133fbd33
2 files changed
+7
-1
No files matched your search
@@ -262,7 +262,9 @@ export async function GET(req: Request) {
|
||||
}
|
||||
|
||||
const headlineSize = fit.fontSize * s
|
||||
const headlineLineHeight = Math.round(headlineSize * HEADLINE.lineHeight)
|
||||
const headlineLineHeight = Math.round(
|
||||
headlineSize * (fit.lineCount === 2 ? HEADLINE.lineHeightTwoLine : HEADLINE.lineHeight)
|
||||
)
|
||||
// Gap between highlight runs on a line — a real space glyph's advance
|
||||
// width at the rendered size, applied as marginLeft (see textBlock below).
|
||||
const spaceWidthPx = measureLineWidth(headlineFont, ' ', headlineSize, HEADLINE.letterSpacing)
|
||||
|
||||
@@ -27,6 +27,10 @@ export const typography = {
|
||||
compact: { minSize: 40, maxSize: 56 },
|
||||
},
|
||||
lineHeight: 1.1,
|
||||
// Slightly looser leading once a headline wraps to 2 lines — 1.1 reads
|
||||
// fine for a single line but feels a touch tight once there's a
|
||||
// second line stacked underneath.
|
||||
lineHeightTwoLine: 1.2,
|
||||
letterSpacing: -0.02, // em
|
||||
},
|
||||
eyebrow: {
|
||||
|
||||
Reference in new issue
Block a user