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 commitc8ea10c580ac04dd925a4cef1bc0fba595ecc9daParent: 9234ff6Some 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
2 changed files +9 -0
- scripts/audit/measure.ts +6 -0
- style/_one.scss +3 -0
scripts/audit/measure.tsmodified+6 -0
| @@ -218,6 +218,12 @@ const ALIGN = `((root) => { | |||
| 218 | if (Math.abs(mid(kb) - mid(a)) > 2) bad.push('acts row off centre ' + Math.round(mid(kb) - mid(a)) + 'px: ' + name(k)); | 218 | if (Math.abs(mid(kb) - mid(a)) > 2) bad.push('acts row off centre ' + Math.round(mid(kb) - mid(a)) + 'px: ' + name(k)); |
| 219 | } | 219 | } |
| 220 | } | 220 | } |
| 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 | + } | ||
| 221 | for (const form of root.querySelectorAll('.fields')) { | 227 | for (const form of root.querySelectorAll('.fields')) { |
| 222 | if (!seen(form) || form.getBoundingClientRect().width < 500) continue; | 228 | if (!seen(form) || form.getBoundingClientRect().width < 500) continue; |
| 223 | const fields = [...form.querySelectorAll('.field')].filter((f) => seen(f) && f.closest('.fields') === form && getComputedStyle(f).display === 'grid'); | 229 | 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 { | |||
| 3661 | .sec > :is(a.act, button.act), | 3661 | .sec > :is(a.act, button.act), |
| 3662 | .sec > details > summary.act, | 3662 | .sec > details > summary.act, |
| 3663 | .sec > form > button.act:only-of-type { | 3663 | .sec > form > button.act:only-of-type { |
| 3664 | + display: inline-flex; | ||
| 3665 | + align-items: center; | ||
| 3666 | + width: fit-content; | ||
| 3664 | height: var(--control-sm); | 3667 | height: var(--control-sm); |
| 3665 | margin-left: 0; | 3668 | margin-left: 0; |
| 3666 | padding: 0 14px; | 3669 | padding: 0 14px; |