Skip to content

Commit 0f944c2

Browse files
RuitingMaclaude
andcommitted
Layout: document section-spacing convention shared by NOTE + ESSAY
The CSS already applies uniformly to every essay collection entry regardless of `kind`, but that fact lived in nobody's head — the comment just said "Markdown renders each <section> we declared". Make the contract explicit: the convention is `<section data-cue="…">` per beat; whatever you get for free (72vh min-height, inter-section rule, trailing quiet, reading-line tracking) follows from that opt-in. Pieces that don't bother with sections still render fine; they just fall back to standard prose flow. No behavior change — just docs at the rule that authors hit when they copy a draft and wonder why the spacing happens. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent be6a2cc commit 0f944c2

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

src/layouts/EssayLayout.astro

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,27 @@ const tintClass = tint ? `tint-${tint}` : '';
170170
margin: 0 0 3em;
171171
}
172172

173-
/* Markdown renders each <section> we declared; apply spacing globally
174-
because the author wrote raw HTML inside their .md file. */
173+
/* === Section spacing convention =============================
174+
Shared by every essay collection entry regardless of `kind`
175+
(NOTE or ESSAY) — both flavors route through this layout, so
176+
whatever rules land here apply uniformly.
177+
178+
Authoring: wrap each beat of the piece in
179+
<section data-cue="NAME">…</section>
180+
inline in the .md/.mdx file. The :global selector lets these
181+
reach raw HTML children. `data-cue` separately drives stage-side
182+
visual transitions (see the <script> block above) — the cue name
183+
is content-side metadata for the sketch, not a styling hook.
184+
185+
What you get for free by following the convention:
186+
• 72vh minimum height per section, flex-centered content
187+
• 1px rule between adjacent sections
188+
• Reading-line tracking so the stage canvas can react per beat
189+
• Generous trailing quiet under the last section
190+
191+
A piece that opts out (just markdown headings, no <section>) is
192+
fine; it just gets standard prose flow without the per-beat
193+
pacing. The dev-only Score 组件测试页 is the current opt-out. */
175194
.body :global(section) {
176195
min-height: 72vh;
177196
padding: 1.6em 0 2.2em;

0 commit comments

Comments
 (0)