Repository navigation
Conversation
Propose one rule for spacing inside and between components: a box owns only its inset, the parent owns the space between siblings, steps are on a 4px scale, a control's height is its line box plus its block inset, and density moves only that inset. Record three agreed points (density, 2px steps, the role API) and the details decided with them. Add six figures rendered from real components with measured redline overlays. No code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Code Metrics Report
Details | | main (e4b5616) | #735 (840a6be) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 62.9% | 62.9% | 0.0% |
| Files | 294 | 294 | 0 |
| Lines | 13513 | 13513 | 0 |
| Covered | 8505 | 8505 | 0 |
- | Test Execution Time | 4m29s | 4m31s | +2s |Reported by octocov |
wemra3
marked this pull request as ready for review
November 18, 2026 00:10
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Motivation
Part of tailor-inc/platform-planning#2484.
AppShell has no spacing rule. Each component writes its own padding, gap and margin classes, so most values agree but some do not: 16 sibling gaps use a 2px step, several components set a margin on their own root, nine places cancel the parent's inset with a negative margin, and containers such as
Card.ContentandFormhave no gap, so pages writespace-y-*by hand (488 classes in 131 of 418 erp-kit template files). This PR proposes one rule for spacing and records the points already agreed.Summary
This PR adds
decisions/spacing-roles.mdand six figures. It changes no code.The rule, from the record:
What this decides
size. An ancestor marker sets CSS variables for the block inset of controls and rows (Carbon's model). Underpointer: coarse, the same variables get larger values (Primer's model). Box insets do not move.gapprop (none/tight/normal/loose= 0 / 8 / 16 / 24) onCard.Content,Form,Fieldset.Root,Tabs.Panel,Dialog.ContentandSheet.Content, and a newInlineprimitive for horizontal rows. NoStackprimitive.gapprops default tononeuntil the next major, so no page moves. Docs and templates pass the value explicitly.Toolbar.Groupstays a toolbar part and its gap becomes 8. The space between a label and its control is inside a component.What is not decided
pointer: coarse.Grid's default gap of 12.Figures
Real components from the vite example at
b4ede51, 1280px. Blue lines frame elements; red dimension lines showinset,gap,marginorinside, with the measured value. Panels marked "proposed" or "simulated" add CSS to show a state that does not exist yet.Toolbar.Group6 to 8none: a default of 16 plus an existingspace-y-4gives 32ActionPanelwith a −12 margin, and the same rows with an inset of 20 and no marginHow to review
b4ede51). It is the input for the implementation issues, not part of this PR.🤖 Generated with Claude Code