Conversation
Headings render with a fixed 0.3 rem bottom padding, so stacked headings and a heading above body text always sit tight regardless of the view's spacing. Add `TextViewStyle::heading_gap` (with `with_heading_gap`), mirroring the existing `paragraph_gap`, and use it for the heading's bottom padding. The default stays 0.3 rem, so existing output is unchanged.
wweziza
added a commit
to wweziza/letronna
that referenced
this pull request
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
TextViewStyle::heading_gap(getter) andwith_heading_gap(setter), mirroring the existingparagraph_gap, and use it for the heading's bottom padding in the block renderer.Why
Headings render with a hard-coded
.pb(rems(0.3)), so stacked headings, and a heading above body text, always sit tight no matter what spacing the surrounding view wants. There is no way to loosen it fromTextViewStylethe wayparagraph_gapalready allows for paragraphs.Behavior
The default is
rems(0.3), identical to the current constant, so existing output is unchanged. Callers that want roomier headings can now do:Notes
One focused change following the
paragraph_gappattern:crates/base/src/text/style.rs: field, PartialEq arm, default,with_heading_gap,heading_gap().crates/base/src/text/node.rs: heading usesnode_cx.style.heading_gap()instead of the constant.