.forge/prs/42793d4f-8900-4591-87ae-f186901eea08/patch.diff 4.5 KiB 109 lines Raw
1 From de7abd6a58e5247013cf47d8382647c9d42ac37d Mon Sep 17 00:00:00 20012 From: gl0w <gl0w@world>3 Date: Wed, 28 Oct 2026 11:35:11 +00004 Subject: [PATCH] normalize code-page vertical spacing (#122)5 6 ---7  .../issue.md                                  | 25 +++++++++++++++++++8  static/style.css                              | 15 ++++++++++-9  tests/code_cols.rs                            | 22 ++++++++++++++++10  3 files changed, 61 insertions(+), 1 deletion(-)11  create mode 100644 .forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md12 13 diff --git a/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md b/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md14 new file mode 10064415 index 0000000..c5a4a9616 --- /dev/null17 +++ b/.forge/issues/b243e09f-a9fa-4507-96e2-2c48b4f8e719/issue.md18 @@ -0,0 +1,25 @@19 +---20 +id: b243e09f-a9fa-4507-96e2-2c48b4f8e71921 +title: Normalize code-page vertical spacing22 +state: open23 +labels:24 +- area:render25 +assignees: []26 +milestone: null27 +created: 2026-10-28T11:32:06.967801627Z28 +updated: null29 +---30 +## Problem31 +32 +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.33 +34 +## Fix35 +36 +Use one explicit vertical scale on the code page:37 +38 +- 24px between major blocks (repo header, Files, Languages, README)39 +- 12px from a section heading to its content40 +- 8px from language bar to legend41 +- 12px between repo title and clone box42 +43 +Scope the rules to `.repo-head`, `.code-files`, `.langs`, and `.code-readme`; do not change markdown body rhythm.44 diff --git a/static/style.css b/static/style.css45 index ee5bf41..f40f831 10064446 --- a/static/style.css47 +++ b/static/style.css48 @@ -138,7 +138,7 @@ td code,th code{word-break:break-all}49  td.title,td.sha{overflow-wrap:anywhere}50  td.num{width:1%;white-space:nowrap}51  /* Single-column stack; children keep DOM order. */52 -.cols{display:grid;grid-template-columns:minmax(0,1fr);gap:1.5rem;min-width:0}53 +.cols{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s5);min-width:0}54  .cols>section,.cols>div{min-width:0}55  /* Forms: full-width on mobile, >=40px touch targets. */56  form{max-width:44rem;margin:1rem 0;min-width:0}57 @@ -285,6 +285,19 @@ details.clonebox:not([open]){padding-bottom:.25rem}58  .clonebox .clone-body{margin:0}59  .clonebox .clone-body>:first-child{margin-top:.75rem}60  .clone-hint,.clonebox summary .muted{font-weight:400}61 +/* Code page vertical rhythm (f0rge #122): one scale instead of browser62 +   heading margins. 24px between major blocks, 12px heading -> content,63 +   8px language bar -> legend. Scoped so markdown body flow is unchanged. */64 +.repo-head{margin-top:var(--s5);margin-bottom:var(--s5);gap:var(--s3)}65 +.repo-head h1{margin:0}66 +.repo-head .clonebox{margin:0}67 +.code-files>h2,.code-readme>h2{margin:0 0 var(--s3)}68 +.code-files>.table-scroll{margin:0}69 +.langs{margin:var(--s5) 0 0}70 +.langs>h2{margin:0 0 var(--s3)}71 +.lang-bar{margin:0}72 +.lang-legend{margin:var(--s2) 0 0}73 +.code-readme .markdown>:first-child{margin-top:0}74  /* CI verdict badges (m6/code-bits, f0rge #43): GitHub-style green/red on75     the code repo-head; running/cancelled keep muted tones. */76  .badge{display:inline-block;padding:.1em .5em;border:1px solid var(--border);font-weight:700;font-size:.85rem}77 diff --git a/tests/code_cols.rs b/tests/code_cols.rs78 index c73a045..03c620d 10064479 --- a/tests/code_cols.rs80 +++ b/tests/code_cols.rs81 @@ -143,3 +143,25 @@ fn code_tab_is_always_stacked() {82          "wide layout keeps the readable content width"83      );84  }85 +86 +#[test]87 +fn code_page_uses_one_vertical_rhythm() {88 +    let css = css();89 +    // f0rge #122: explicit code-page rhythm, not browser heading margins.90 +    // 24px between major blocks, 12px heading -> content, 8px bar -> legend.91 +    for rule in [92 +        ".cols{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s5)",93 +        ".repo-head{margin-top:var(--s5);margin-bottom:var(--s5);gap:var(--s3)}",94 +        ".repo-head h1{margin:0}",95 +        ".repo-head .clonebox{margin:0}",96 +        ".code-files>h2,.code-readme>h2{margin:0 0 var(--s3)}",97 +        ".code-files>.table-scroll{margin:0}",98 +        ".langs{margin:var(--s5) 0 0}",99 +        ".langs>h2{margin:0 0 var(--s3)}",100 +        ".lang-bar{margin:0}",101 +        ".lang-legend{margin:var(--s2) 0 0}",102 +        ".code-readme .markdown>:first-child{margin-top:0}",103 +    ] {104 +        assert!(css.contains(rule), "code-page rhythm rule missing: {rule}");105 +    }106 +}107 -- 108 2.56.0109