fix: style tiles wide enough for the whole name

'Überschrift 4' measures 58.4px against 56px of inner width, so the two
characters that got cut were the ones telling the five headings apart.
Six pixels wider, and no name in either locale truncates.
This commit is contained in:
Steffen Becker committed 2026-08-12 19:51:36 +02:00
1 parent 4b84e2efac
commit 7b3c1da64e
1 file changed
+6 -3
@@ -51,8 +51,8 @@
}
// Previews the style at 1px per pt. A tile takes 21 as its ceiling — measured:
// the widest four letters at that size still clear its 56px of inner width — and
// a menu row keeps the smaller one, since it also carries a shortcut hint.
// the widest four letters at that size still clear its inner width — and a menu
// row keeps the smaller one, since it also carries a shortcut hint.
function tileStyle(name: string, max = 15): string {
const s = resolveStyle(sheet, name);
const pt = s.text.fontSizePt ?? 12;
@@ -152,7 +152,10 @@
align-items: center;
gap: 2px;
flex-shrink: 0;
width: 66px;
/* Wide enough for the longest style name in either locale: 'Überschrift 4'
measures 58.4px, and truncating a numbered family before its number tells
the five headings apart not at all. */
width: 72px;
border: 1px solid var(--w-border);
border-radius: 4px;
background: var(--w-surface);