Skip to content

🐛 fix asymmetric padding in admonition content (live preview)#369

Merged
ebullient merged 1 commit intomainfrom
claude/quizzical-easley
Mar 28, 2026
Merged

🐛 fix asymmetric padding in admonition content (live preview)#369
ebullient merged 1 commit intomainfrom
claude/quizzical-easley

Conversation

@ebullient
Copy link
Copy Markdown
Owner

@ebullient ebullient commented Mar 28, 2026

Summary

  • Fixes asymmetric top/bottom padding on admonition content in live preview (🐞 Weird Spacing #336)
  • The selectors &:first-child / &:last-child were targeting the .admonition-content div based on its position within the callout wrapper — but since the title div is always the first child, the content div is never :first-child for titled admonitions
  • Only the margin-bottom: 0.8rem rule ever fired, adding extra space at the bottom only
  • Changed to > :first-child / > :last-child to target elements inside the content div, giving symmetric 0.8rem spacing on both sides

Test plan

  • Create a titled \``ad-noteblock and a native> [!note]` callout with the same single-line content
  • Confirm top and bottom internal padding look balanced in live preview
  • Confirm the same in reading view
  • Confirm no-title admonitions still render without extra spacing
  • Confirm collapsible admonitions still expand/collapse correctly

🤖 Generated with Claude Code

In live preview, &:first-child on .admonition-content (the content div
itself) never fired for titled admonitions because the title div is always
the first child. Only &:last-child fired, adding 0.8rem margin to the
bottom only.

Change to > :first-child / > :last-child to target elements *inside* the
content div, giving symmetric 0.8rem top and bottom spacing.

Fixes #336

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ebullient ebullient merged commit 2762a30 into main Mar 28, 2026
1 check passed
@ebullient ebullient deleted the claude/quizzical-easley branch March 28, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant