fix(stack): Hide leading, consectuive, and trailing dividers with CSS - #1202
Open
pawelgrimm wants to merge 6 commits into
Open
fix(stack): Hide leading, consectuive, and trailing dividers with CSS#1202pawelgrimm wants to merge 6 commits into
pawelgrimm wants to merge 6 commits into
Conversation
pawelgrimm
force-pushed
the
pawel/fix/stack-hide-leading-divider
branch
from
September 3, 2026 18:03
b3afb85 to
65f5a32
Compare
pawelgrimm
force-pushed
the
pawel/fix/stack-hide-leading-divider
branch
from
September 3, 2026 18:08
845667c to
791a25a
Compare
pawelgrimm
marked this pull request as ready for review
September 3, 2026 18:08
doistbot
reviewed
Sep 3, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR hides leading, consecutive, and trailing dividers in Stack with CSS, fixing stray dividers when children render null.
Few things worth tightening:
- The
styles.stackclass is applied unconditionally, so a user-supplied<hr>as a first, last, or adjacent child can get hidden even whendividers="none". Consider applying the class only when dividers are enabled, or scoping the selectors to the generatedDivider. - Text-node children break the sibling-selector logic: in
<Stack dividers="primary"><div>A</div>B</Stack>, the needed divider beforeBgets hidden since CSS selectors only see elements. Wrapping primitive children or marking their dividers would fix this. - The existing
renders dividers when instructed to do sosnapshots need updating — they don't expect the newstackclass on every rendered Stack, so the Jest suite will fail.
pawelgrimm
force-pushed
the
pawel/fix/stack-hide-leading-divider
branch
from
September 3, 2026 20:33
cde3e2d to
ccce32e
Compare
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.
Short description
Previously, if you used
<Stack>with thedividersoption, and one of the children returned null, we would still display a divider between each child, potentially resulting in leading, consecutive, or trailing dividers. Now, we hide those extra dividers with CSS.📸 Demo
PR Checklist