diff --git a/scripts/audit/measure.ts b/scripts/audit/measure.ts index ae90838..ef9c042 100644 --- a/scripts/audit/measure.ts +++ b/scripts/audit/measure.ts @@ -218,6 +218,12 @@ const ALIGN = `((root) => { if (Math.abs(mid(kb) - mid(a)) > 2) bad.push('acts row off centre ' + Math.round(mid(kb) - mid(a)) + 'px: ' + name(k)); } } + // A filled action is as wide as its words: one stretched across its row reads as a banner. + for (const e of root.querySelectorAll('a, button, summary')) { + if (!seen(e) || getComputedStyle(e).backgroundColor === 'rgba(0, 0, 0, 0)' || e.closest('.choice, .rail, .tabs, .menu-list, .tab-more-list, .palette-box, .swatches')) continue; + const t = line(e), b = e.getBoundingClientRect(); + if (t !== b && b.width - t.width > 120 && b.width > 2 * t.width) bad.push('stretched action ' + Math.round(b.width) + 'px for ' + Math.round(t.width) + 'px of words: ' + name(e)); + } for (const form of root.querySelectorAll('.fields')) { if (!seen(form) || form.getBoundingClientRect().width < 500) continue; const fields = [...form.querySelectorAll('.field')].filter((f) => seen(f) && f.closest('.fields') === form && getComputedStyle(f).display === 'grid'); diff --git a/style/_one.scss b/style/_one.scss index 55a58bd..3839dd0 100644 --- a/style/_one.scss +++ b/style/_one.scss @@ -3661,6 +3661,9 @@ details.log-group { .sec > :is(a.act, button.act), .sec > details > summary.act, .sec > form > button.act:only-of-type { + display: inline-flex; + align-items: center; + width: fit-content; height: var(--control-sm); margin-left: 0; padding: 0 14px;