Repository navigation
Doors: a shared minimum padding and gap for framed boxes - #1140
LukasWallrich wants to merge 2 commits into
Conversation
Two tokens in tokens.css set the least space between a framed box's edge and its text (16 px, 14 px top and bottom for one-line bars) and between two framed boxes (16 px). Applied where a scratch audit found boxes below 12 px: disclosures, the phone contents box, publication citations, the steering committee grid on phones and the AI metascience programme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…spacing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
📝 Spell Check ResultsFound 8 potential spelling issue(s) when checking 1 changed file(s): 📄
|
| Line | Issue |
|---|---|
| 614 | nIn ==> inn, min, bin, nine |
| 614 | nWe ==> new |
| 614 | nWe ==> new |
| 614 | nIn ==> inn, min, bin, nine |
| 614 | nWe ==> new |
| 614 | nWe ==> new |
| 614 | nWe ==> new |
| 614 | nWe ==> new |
ℹ️ How to address these issues:
- Fix the typo: If it's a genuine typo, please correct it.
- Add to whitelist: If it's a valid word (e.g., a name, technical term), add it to
.codespell-ignore.txt - False positive: If this is a false positive, please report it in the PR comments.
🤖 This check was performed by codespell
There was a problem hiding this comment.
5 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="assets/css/doors/article.css">
<violation number="1" location="assets/css/doors/article.css:126">
P2: This shared body padding also reaches the compact list-item Statistics spoilers, despite their explicit small-toggle styling. Add a compact `li .spoiler-body` override so opening an entry does not gain the framed-box spacing.</violation>
<violation number="2" location="assets/css/doors/article.css:183">
P2: This selector never matches the generated team bands on phones: every title card is the first child of its own `.sc-team`. Select non-first `.sc-team` elements instead, or later team names never receive the intended extra 16px separation.</violation>
</file>
<file name="assets/css/doors/tokens.css">
<violation number="1" location="assets/css/doors/tokens.css:35">
P2: `--box-pad-y` is documented for one-line bars, but the new usages apply it to the multi-line On this page box and citation text. Use `var(--box-pad)` for those boxes so they retain the declared 16px vertical minimum.</violation>
</file>
<file name="content/ai-metascience/index.md">
<violation number="1" location="content/ai-metascience/index.md:21">
P2: The recording cards now use the shared gap but still retain 12px × 14px inner padding, below the 16px minimum for framed boxes. Change `.am-playlist` to `padding: var(--box-pad)`; these two-line cards are not small chip controls.</violation>
<violation number="2" location="content/ai-metascience/index.md:236">
P2: These framed session cards still have only 10px top and 6px bottom padding, while the solo variant has just 6px at the top. Use the shared vertical token for the session padding and its solo override so the new box-spacing contract is actually met.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| .article-layout .article-style .spoiler>summary{padding:var(--box-pad-y) var(--box-pad);font-weight:600;font-size:18px;line-height:1.35;color:var(--link);cursor:pointer} | ||
| .article-layout .article-style .spoiler>summary:hover{color:var(--ink)} | ||
| .article-layout .article-style .spoiler-body{padding:2px 14px 12px;font-size:18px;line-height:1.55} | ||
| .article-layout .article-style .spoiler-body{padding:2px var(--box-pad) var(--box-pad);font-size:18px;line-height:1.55} |
There was a problem hiding this comment.
P2: This shared body padding also reaches the compact list-item Statistics spoilers, despite their explicit small-toggle styling. Add a compact li .spoiler-body override so opening an entry does not gain the framed-box spacing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At assets/css/doors/article.css, line 126:
<comment>This shared body padding also reaches the compact list-item Statistics spoilers, despite their explicit small-toggle styling. Add a compact `li .spoiler-body` override so opening an entry does not gain the framed-box spacing.</comment>
<file context>
@@ -120,10 +120,10 @@ main:lang(ar) .article-layout .article-style,main:lang(ar) .article-layout .arti
+.article-layout .article-style .spoiler>summary{padding:var(--box-pad-y) var(--box-pad);font-weight:600;font-size:18px;line-height:1.35;color:var(--link);cursor:pointer}
.article-layout .article-style .spoiler>summary:hover{color:var(--ink)}
-.article-layout .article-style .spoiler-body{padding:2px 14px 12px;font-size:18px;line-height:1.55}
+.article-layout .article-style .spoiler-body{padding:2px var(--box-pad) var(--box-pad);font-size:18px;line-height:1.55}
.article-layout .article-style .spoiler-body>:last-child{margin-bottom:0}
/* Disclosures hold prose, so they stay at reading width unless a PDF is open inside one. */
</file context>
| /* On a phone the cards and team names share one grid: the box gap between them, and a team's name further | ||
| from the cards of the team before it than from its own. */ | ||
| .sc-page .sc-grid{gap:var(--box-gap)} | ||
| @media(max-width:760px){.sc-page .sc-grid .sc-title-card:not(:first-child){margin-top:var(--box-gap)}} |
There was a problem hiding this comment.
P2: This selector never matches the generated team bands on phones: every title card is the first child of its own .sc-team. Select non-first .sc-team elements instead, or later team names never receive the intended extra 16px separation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At assets/css/doors/article.css, line 183:
<comment>This selector never matches the generated team bands on phones: every title card is the first child of its own `.sc-team`. Select non-first `.sc-team` elements instead, or later team names never receive the intended extra 16px separation.</comment>
<file context>
@@ -172,11 +172,15 @@ main:lang(ar) .article-layout .article-style,main:lang(ar) .article-layout .arti
+/* On a phone the cards and team names share one grid: the box gap between them, and a team's name further
+ from the cards of the team before it than from its own. */
+.sc-page .sc-grid{gap:var(--box-gap)}
+@media(max-width:760px){.sc-page .sc-grid .sc-title-card:not(:first-child){margin-top:var(--box-gap)}}
@media(min-width:761px){
.sc-page .sc-grid{gap:28px 40px}
</file context>
| @media(max-width:760px){.sc-page .sc-grid .sc-title-card:not(:first-child){margin-top:var(--box-gap)}} | |
| @media(max-width:760px){.sc-page .sc-grid .sc-team:not(:first-child)>.sc-title-card{margin-top:var(--box-gap)}} |
| a box's edge and its text, and between two boxes side by side or one above the other. A component may | ||
| use more, never less. Small controls and chips (buttons, pills, tags) and joined groups are exempt. */ | ||
| --box-pad:16px; | ||
| --box-pad-y:14px; /* top and bottom of a one-line bar, such as a disclosure's summary */ |
There was a problem hiding this comment.
P2: --box-pad-y is documented for one-line bars, but the new usages apply it to the multi-line On this page box and citation text. Use var(--box-pad) for those boxes so they retain the declared 16px vertical minimum.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At assets/css/doors/tokens.css, line 35:
<comment>`--box-pad-y` is documented for one-line bars, but the new usages apply it to the multi-line On this page box and citation text. Use `var(--box-pad)` for those boxes so they retain the declared 16px vertical minimum.</comment>
<file context>
@@ -28,4 +28,10 @@
+ a box's edge and its text, and between two boxes side by side or one above the other. A component may
+ use more, never less. Small controls and chips (buttons, pills, tags) and joined groups are exempt. */
+ --box-pad:16px;
+ --box-pad-y:14px; /* top and bottom of a one-line bar, such as a disclosure's summary */
+ --box-gap:16px;
}
</file context>
| .am-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--box-gap); margin: 18px 0 6px; max-width: 620px; } | ||
| .article-layout .article-style .am-playlist { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 2px solid var(--am-deep) !important; border-radius: 12px; background: var(--am-tint, #eef5f3); color: var(--am-ink); text-decoration: none !important; font-size: 15px; line-height: 1.3; } |
There was a problem hiding this comment.
P2: The recording cards now use the shared gap but still retain 12px × 14px inner padding, below the 16px minimum for framed boxes. Change .am-playlist to padding: var(--box-pad); these two-line cards are not small chip controls.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/ai-metascience/index.md, line 21:
<comment>The recording cards now use the shared gap but still retain 12px × 14px inner padding, below the 16px minimum for framed boxes. Change `.am-playlist` to `padding: var(--box-pad)`; these two-line cards are not small chip controls.</comment>
<file context>
@@ -18,7 +18,7 @@ image:
<style>
-.am-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; max-width: 620px; }
+.am-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--box-gap); margin: 18px 0 6px; max-width: 620px; }
.article-layout .article-style .am-playlist { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 2px solid var(--am-deep) !important; border-radius: 12px; background: var(--am-tint, #eef5f3); color: var(--am-ink); text-decoration: none !important; font-size: 15px; line-height: 1.3; }
.article-layout .article-style .am-playlist strong { color: var(--am-deep); font-size: 17px; }
</file context>
| .am-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--box-gap); margin: 18px 0 6px; max-width: 620px; } | |
| .article-layout .article-style .am-playlist { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 2px solid var(--am-deep) !important; border-radius: 12px; background: var(--am-tint, #eef5f3); color: var(--am-ink); text-decoration: none !important; font-size: 15px; line-height: 1.3; } | |
| .am-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--box-gap); margin: 18px 0 6px; max-width: 620px; } | |
| .article-layout .article-style .am-playlist { display: flex; flex-direction: column; gap: 2px; padding: var(--box-pad); border: 2px solid var(--am-deep) !important; border-radius: 12px; background: var(--am-tint, #eef5f3); color: var(--am-ink); text-decoration: none !important; font-size: 15px; line-height: 1.3; } |
| margin: 0 0 10px; | ||
| padding: 8px 12px 4px; | ||
| margin: 0 0 var(--box-gap); | ||
| padding: 10px var(--box-pad) 6px; |
There was a problem hiding this comment.
P2: These framed session cards still have only 10px top and 6px bottom padding, while the solo variant has just 6px at the top. Use the shared vertical token for the session padding and its solo override so the new box-spacing contract is actually met.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/ai-metascience/index.md, line 236:
<comment>These framed session cards still have only 10px top and 6px bottom padding, while the solo variant has just 6px at the top. Use the shared vertical token for the session padding and its solo override so the new box-spacing contract is actually met.</comment>
<file context>
@@ -232,14 +232,14 @@ image:
- margin: 0 0 10px;
- padding: 8px 12px 4px;
+ margin: 0 0 var(--box-gap);
+ padding: 10px var(--box-pad) 6px;
border: 1px solid var(--am-rule);
border-left: 4px solid var(--am-accent);
</file context>
What changes for visitors
Panels, cards and disclosures that sat too close to their own text or to the box next to them now have at least 16 px of room. Visitors will notice this on:
The differences are a few pixels per box. The cause was that each component set its own padding and gap (8, 10 or 12 px), with no shared minimum.
The shared default
tokens.cssgets three spacing tokens for framed boxes (anything with its own fill or border):The components the audit flagged now use them. The comment in
tokens.csssays a component may use more space but never less, and that small controls, chips and joined groups (tabs, segmented controls) are exempt.Before and after
Disclosures (/about/us/), 390 and 1440 px


Phone "On this page" box (/about/us/), 390 px. It shows only on phones.

Citation box (/publications/, "Cite this" open), 390 and 1440 px


Steering committee (/about/steering-committee/): the grid at 390 px, and the team name band at 1440 px, where only its padding changes


AI metascience programme session (/ai-metascience/), 390 and 1440 px


AI metascience recording links, 390 and 1440 px


How the problems were found
A scratch Playwright audit (not committed) checked about 100 pages: one of each template family plus every section page. It ran at 390 and 1440 px, and the main 24 pages also at 1024 px. A second pass opened the phone menu, the mega menu, search, the resources filter drawer and a glossary popover. The audit treats a box as framed if it has its own fill, a border on at least three sides, or a shadow. It reported:
Every hit was checked against a screenshot.
Left alone, as deliberate or not a defect:
article.csssays they are "laid edge to edge like a short wall".Not changed here, because #1137 owns the files (
clusters.css,lists.css,layouts/partials/clusters/):.nla-grid,lists.css) are 10 px apart./clusters/cluster-1/ and /disciplines/ were not touched: none of the changed selectors matches them.
Decisions to review
content/ai-metascience/index.md). It is hand-written, not generated, so it was edited there to use the tokens.Checks
python3 scripts/check_seo_html.py: passedpython3 -m unittest discover -s scripts/tests: 145 tests, OKpython3 scripts/rebrand/check_design.py: fails with the same 4 failures asrebrand-doorsbefore this change: lines of 80 characters or more on two Arabic glossary terms (العلم_المفتوح and the digital object identifier term) at 1024 and 1440 px. Nothing new🤖 Generated with Claude Code
Summary by cubic
Adds shared spacing tokens so framed boxes—cards, panels, disclosures, and bars with their own fill or border—keep at least 16 px between their edge and text, and at least 16 px between boxes. Panels, citations, disclosures, and the phone contents box that previously used 8–12 px now meet this minimum.
The new
--box-pad,--box-pad-y, and--box-gaptokens intokens.cssare the single source for this minimum. Small controls and chips are exempt, as are joined groups like tabs. Applied the tokens to disclosures, the phone contents box, publication citations, steering committee cards (desktop unchanged), and the AI metascience programme sessions and recording links. The steering committee grid on phones now adds an extra 16 px above each team name so it groups with its own people.Decision points
Written for commit e95afb6. Summary will update on new commits.