feat: let inset dock take a second value for the spanned sides - #246
Merged
Conversation
Values are consumed positionally by the named directions — `inset: '1x 2x left right'` sets left 1x and right 2x — so the value after the directional ones now applies to the perpendicular pair a `dock` spans: inset: '2x 4x bottom dock' -> inset: auto 32px 16px 32px With no second value the span keeps reusing the edge's own value, so `inset: 'bottom dock'` and `inset: '2x bottom dock'` are unchanged. The span is applied before the explicitly named directions so a named direction always wins over the value it would inherit as a perpendicular side. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
📦 Snapshot releasePublished |
Merged
5 tasks
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.
Follow-up to #244.
dockshipped in 2.10.0 applying a single value to both the pinned edge and the sides it spans, so there was no way to inset the sides differently from the edge.Change
Values are already consumed positionally by the named directions:
So the value after the directional ones now applies to the perpendicular pair that
dockspans:With no second value the span keeps reusing the edge's own value, so everything released in 2.10.0 is unchanged:
The span pass runs before the explicitly named directions, so a named direction always wins over the value it would otherwise inherit as a perpendicular side.
Note on the first slot
The requested shape was
inset: '0 32x 16x 32x'; this emitsauto 32px 16px 32px. The32/16/32match — the difference is the un-docked edge, which staysautorather than becoming0.That's deliberate and consistent with 2.10.0:
inset: 'bottom dock'givesauto 0 0 0. Pinning the opposite edge to0as well would stretch the element vertically, which is the opposite of docking it to the bottom. Happy to change it if0was actually intended rather than shorthand for "untouched".Reviewer notes
tsc,eslint,prettierclean, all five size-limit entries within budget.inset: '1x 2x bottom left dock'. My expected value was wrong, and tracing the real behaviour (16px 8px 8px 16px) showed why: with two directions, each one's span writes over the other's. Combiningdockwith several edges has no well-defined meaning, so rather than lock in confusing output with a test I left it unasserted and documenteddockas intended for a single edge.🤖 Generated with Claude Code