diff --git a/src/lib/components/ribbon/controls/StyleGallery.svelte b/src/lib/components/ribbon/controls/StyleGallery.svelte index 2174eb9..c3162f3 100644 --- a/src/lib/components/ribbon/controls/StyleGallery.svelte +++ b/src/lib/components/ribbon/controls/StyleGallery.svelte @@ -50,11 +50,13 @@ return shortcutHint(`heading${level}` as ShortcutId); } - // The tile previews its own style, clamped so a 28pt Title still fits the row. - function tileStyle(name: string): string { + // 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. + function tileStyle(name: string, max = 15): string { const s = resolveStyle(sheet, name); const pt = s.text.fontSizePt ?? 12; - return `font-size: ${Math.min(15, Math.max(9, pt * 0.62))}px;` + return `font-size: ${Math.min(max, Math.max(Math.min(13, max), pt))}px;` + `font-weight: ${s.text.bold ? 700 : 400};` + `font-style: ${s.text.italic ? 'italic' : 'normal'};` + `font-family: ${s.text.fontFamily ?? 'inherit'};` @@ -89,7 +91,7 @@ title={styleShortcut(s.name) ? `${label(s.name)} (${styleShortcut(s.name)})` : label(s.name)} aria-pressed={current === s.name} > - AaBbCc + AaBb {label(s.name)} {/each} @@ -120,10 +122,13 @@