forge
Explore
Log in

Don't you dare go Hollow

A topic's own action is as wide as its words, so Delete release under a release is a small red pill instead of a band across the page ✅ test: measure.ts reports a filled action stretched far past its words

Browse files at this commit

c8ea10c580ac04dd925a4cef1bc0fba595ecc9daAhmet Kaan GümüşParent: 9234ff6
Some checks failed
Show checks
  • ✗ci/buildjob was cancelledDetails
  • style
    • a topic's own action is as wide as its words, so Delete release under a release is a small red pill instead of a band across the page ✅ test: measure.ts reports a filled action stretched far past its words
Show full message
💄 style: a topic's own action is as wide as its words, so Delete release under a release is a small red pill instead of a band across the page ✅ test: measure.ts reports a filled action stretched far past its words
scripts/audit/measure.tsmodified+6 -0
@@ -218,6 +218,12 @@ const ALIGN = `((root) => {
218218 if (Math.abs(mid(kb) - mid(a)) > 2) bad.push('acts row off centre ' + Math.round(mid(kb) - mid(a)) + 'px: ' + name(k));
219219 }
220220 }
221+ // A filled action is as wide as its words: one stretched across its row reads as a banner.
222+ for (const e of root.querySelectorAll('a, button, summary')) {
223+ 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;
224+ const t = line(e), b = e.getBoundingClientRect();
225+ 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));
226+ }
221227 for (const form of root.querySelectorAll('.fields')) {
222228 if (!seen(form) || form.getBoundingClientRect().width < 500) continue;
223229 const fields = [...form.querySelectorAll('.field')].filter((f) => seen(f) && f.closest('.fields') === form && getComputedStyle(f).display === 'grid');
style/_one.scssmodified+3 -0
@@ -3661,6 +3661,9 @@ details.log-group {
36613661 .sec > :is(a.act, button.act),
36623662 .sec > details > summary.act,
36633663 .sec > form > button.act:only-of-type {
3664+ display: inline-flex;
3665+ align-items: center;
3666+ width: fit-content;
36643667 height: var(--control-sm);
36653668 margin-left: 0;
36663669 padding: 0 14px;