fix: exclude fixed gaps from distributed leading space - #6
Open
tristanmuzzu wants to merge 1 commit into
Open
tristanmuzzu wants to merge 1 commit into
tristanmuzzu wants to merge 1 commit into
Conversation
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.
With a nonzero main-axis gap,
space-aroundandspace-evenlyinclude that gap in the leading space. For example, a 300px row with 50px and 100px items and a 30px gap places the items at 45/185 instead of 30/170 underspace-around. When flex growth consumes the remaining space, the same offset pushes the last item outside the container.Calculate leading space from the remaining free space alone, while keeping the fixed gap between items. This matches the CSS gap definition. Adds 12 numeric regressions covering rows and columns, both distributions, flex growth, and a single child. The nested SVG snapshot moves only the affected children by 2.5px to remove its existing offset.
Validation: all 12 new tests fail before the fix; all 29 tests pass afterward. Type checking, formatting, build, and
git diff --checkpass. Prepared and verified with an AI coding assistant.Fixes #4. The separate overflow-alignment case is covered by #13.