From de7abd6a58e5247013cf47d8382647c9d42ac37d Mon Sep 17 00:00:00 2001 From: gl0w Date: Wed, 28 Oct 2026 11:35:11 +0000 Subject: [PATCH] normalize code-page vertical spacing (#122) --- .../issue.md | 25 +++++++++++++++++++ static/style.css | 15 ++++++++++- tests/code_cols.rs | 22 ++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md diff --git a/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md b/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md new file mode 100644 index 0000000..c5a4a96 --- /dev/null +++ b/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md @@ -0,0 +1,25 @@ +--- +id: b243e09f-a9fa-4507-96e2-2c48b4f8e719 +title: Normalize code-page vertical spacing +state: open +labels: +- area:render +assignees: [] +milestone: null +created: 2026-10-28T11:32:06.967801627Z +updated: null +--- +## Problem + +The code page inherits a mix of browser heading margins, section margins, and grid gaps. Measured at 1280px: title→clone 24px, clone→Files 60px, Files heading→table ~20px, table→Languages ~20px, Languages→README 40px, README heading→body ~20px. The result reads as arbitrary spacing. + +## Fix + +Use one explicit vertical scale on the code page: + +- 24px between major blocks (repo header, Files, Languages, README) +- 12px from a section heading to its content +- 8px from language bar to legend +- 12px between repo title and clone box + +Scope the rules to `.repo-head`, `.code-files`, `.langs`, and `.code-readme`; do not change markdown body rhythm. diff --git a/static/style.css b/static/style.css index ee5bf41..f40f831 100644 --- a/static/style.css +++ b/static/style.css @@ -138,7 +138,7 @@ td code,th code{word-break:break-all} td.title,td.sha{overflow-wrap:anywhere} td.num{width:1%;white-space:nowrap} /* Single-column stack; children keep DOM order. */ -.cols{display:grid;grid-template-columns:minmax(0,1fr);gap:1.5rem;min-width:0} +.cols{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s5);min-width:0} .cols>section,.cols>div{min-width:0} /* Forms: full-width on mobile, >=40px touch targets. */ form{max-width:44rem;margin:1rem 0;min-width:0} @@ -285,6 +285,19 @@ details.clonebox:not([open]){padding-bottom:.25rem} .clonebox .clone-body{margin:0} .clonebox .clone-body>:first-child{margin-top:.75rem} .clone-hint,.clonebox summary .muted{font-weight:400} +/* Code page vertical rhythm (f0rge #122): one scale instead of browser + heading margins. 24px between major blocks, 12px heading -> content, + 8px language bar -> legend. Scoped so markdown body flow is unchanged. */ +.repo-head{margin-top:var(--s5);margin-bottom:var(--s5);gap:var(--s3)} +.repo-head h1{margin:0} +.repo-head .clonebox{margin:0} +.code-files>h2,.code-readme>h2{margin:0 0 var(--s3)} +.code-files>.table-scroll{margin:0} +.langs{margin:var(--s5) 0 0} +.langs>h2{margin:0 0 var(--s3)} +.lang-bar{margin:0} +.lang-legend{margin:var(--s2) 0 0} +.code-readme .markdown>:first-child{margin-top:0} /* CI verdict badges (m6/code-bits, f0rge #43): GitHub-style green/red on the code repo-head; running/cancelled keep muted tones. */ .badge{display:inline-block;padding:.1em .5em;border:1px solid var(--border);font-weight:700;font-size:.85rem} diff --git a/tests/code_cols.rs b/tests/code_cols.rs index c73a045..03c620d 100644 --- a/tests/code_cols.rs +++ b/tests/code_cols.rs @@ -143,3 +143,25 @@ fn code_tab_is_always_stacked() { "wide layout keeps the readable content width" ); } + +#[test] +fn code_page_uses_one_vertical_rhythm() { + let css = css(); + // f0rge #122: explicit code-page rhythm, not browser heading margins. + // 24px between major blocks, 12px heading -> content, 8px bar -> legend. + for rule in [ + ".cols{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s5)", + ".repo-head{margin-top:var(--s5);margin-bottom:var(--s5);gap:var(--s3)}", + ".repo-head h1{margin:0}", + ".repo-head .clonebox{margin:0}", + ".code-files>h2,.code-readme>h2{margin:0 0 var(--s3)}", + ".code-files>.table-scroll{margin:0}", + ".langs{margin:var(--s5) 0 0}", + ".langs>h2{margin:0 0 var(--s3)}", + ".lang-bar{margin:0}", + ".lang-legend{margin:var(--s2) 0 0}", + ".code-readme .markdown>:first-child{margin-top:0}", + ] { + assert!(css.contains(rule), "code-page rhythm rule missing: {rule}"); + } +} -- 2.56.0