fix(theme): map spacing multiplier scale on inset utilities#299
Merged
Conversation
Insets were plain createUseUtility, so a numeric ref like @0.5 fell
through to a bare token lookup for a non-existent "0.5" variable and
silently emitted an undefined var(--0--5). Swap all 9 inset composables
to createUseSpacingUtility(..., { namespace: "spacing" }) — matching
margin/padding/height — so @0.5 resolves to calc(var(--spacing) * 0.5).
Object-syntax literals and undefined preset calls are unchanged; the
composable signature is identical. Adds multiplier tests asserting
insets emit calc() and no dead vars.
Refs SF-12
🦋 Changeset detectedLatest commit: aea569f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Patch @styleframe/theme and styleframe for the inset spacing-scale fix.
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.
Summary
Insets were plain
createUseUtility, so a numeric ref like@0.5fell through to a bare token lookup for a non-existent0.5variable and silently emitted an undefinedvar(--0--5). This swaps all 9 inset composables (inset,inset-x,inset-y,inset-inline-start,inset-inline-end,top,right,bottom,left) tocreateUseSpacingUtility(..., { namespace: "spacing" })— written exactly likeuseMarginUtility— so insets map the spacing multiplier scale like margin/padding/height.@0.5on an inset →calc(var(--spacing, 1rem) * 0.5), consistent with margin/padding/height.{ "0": "0", auto: "auto" }) and the preset'sundefinedcalls are unchanged — the composable signature is identical.Output-shape note for review: existing
@spacing.xsinset usages now shorten the utility class keyspacing.xs→xs(same as margin); the resolved var is identical.Test plan
pnpm --filter @styleframe/theme test— 3267 passed (incl. 3 new inset multiplier tests assertingcalc(...)and novar(--0--5))pnpm typecheck— greenpnpm lint— green (exit 0, no new warnings)Refs SF-12.