Tighten markdown list spacing around prose

Lists previously had a static marginVertical that stacked with
paragraph.marginBottom, producing 20px gaps and oversized whitespace
around paragraphs sandwiched between lists.

Spacing is now context-aware via the render rule: list -> list keeps
the normal paragraph gap (back-to-back lists read as continuous
content) while p <-> list transitions get a slightly larger gap (lists
read as their own section). Static margins can't satisfy both because
RN doesn't collapse margins, so the bullet_list / ordered_list rule
inspects the next sibling type and picks marginBottom accordingly.
This commit is contained in:
Mohamed Boudra
2026-05-15 14:03:14 +07:00
parent 2f13c83c0e
commit eed61d338c
3 changed files with 100 additions and 15 deletions
@@ -252,13 +252,11 @@ export function createMarkdownStyles(theme: Theme) {
// =========================================================================
bullet_list: {
marginVertical: theme.spacing[2],
paddingLeft: 0,
width: "100%" as const,
},
ordered_list: {
marginVertical: theme.spacing[2],
paddingLeft: 0,
width: "100%" as const,
},