style(headers): improve header spacing - #34
Conversation
📝 WalkthroughWalkthroughDocumentation heading spacing now uses explicit H1 and H2 margins. The article layout removes the margin from the first H2 heading. ChangesDocumentation heading spacing
Estimated code review effort: 1 (Trivial) | ~2 minutes Mergeability Score: 🔵 Low · up to The header-spacing change does not consistently remove the extra top spacing from the first H2 when an article begins with other content. This is a bounded documentation-only visual issue, so the PR is mergeable with explicit owner follow-up. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/lib/components/docs/MarkdownLayout.svelte`:
- Line 38: Update the MarkdownLayout container’s Tailwind selector from
[&>h2:first-child] to target the first direct h2 element by type, ensuring the
first heading receives mt-0 even when preceding content such as a paragraph
exists.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a954c0cb-a8e4-4076-96fc-c4758b6971c2
📒 Files selected for processing (3)
apps/web/src/lib/components/docs/MarkdownLayout.svelteapps/web/src/lib/components/docs/markdown/H1.svelteapps/web/src/lib/components/docs/markdown/H2.svelte
| <article | ||
| data-doc-content | ||
| class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground" | ||
| class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground [&>h2:first-child]:mt-0" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Target the first H2, not only the first child.
h2:first-child matches only when the article starts with an H2. The rendered /docs article has a paragraph before its first H2, so that heading keeps mt-12 instead of receiving the intended exception. Use h2:first-of-type here. (motion-gpu.dev)
Proposed selector fix
- class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground [&>h2:first-child]:mt-0"
+ class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground [&>h2:first-of-type]:mt-0"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground [&>h2:first-child]:mt-0" | |
| class="w-full max-w-4xl space-y-6 text-base leading-relaxed text-foreground [&>h2:first-of-type]:mt-0" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/web/src/lib/components/docs/MarkdownLayout.svelte` at line 38, Update
the MarkdownLayout container’s Tailwind selector from [&>h2:first-child] to
target the first direct h2 element by type, ensuring the first heading receives
mt-0 even when preceding content such as a paragraph exists.
Summary by CodeRabbit