feat(tokens): enable responsiveLayoutMargin token in ResponsiveLayout#1637
Closed
Marcosld wants to merge 1 commit into
Closed
feat(tokens): enable responsiveLayoutMargin token in ResponsiveLayout#1637Marcosld wants to merge 1 commit into
Marcosld wants to merge 1 commit into
Conversation
Introduces the `responsiveLayoutMargin` design token (from mistica-design#2662)
across all skins so ResponsiveLayout margins can vary per brand.
- Adds `ResponsiveMarginValues` type with per-breakpoint values (mobile,
tablet, desktop, largeDesktop) to `SpacingConfig`
- Narrows the `ToThemeTokens` conditional so objects with keys beyond
`{mobile, desktop}` expand as per-breakpoint CSS vars instead of
collapsing to a single var
- Updates `theme-context-provider` to map the new token shape to CSS vars
- Replaces hardcoded pixel constants in `responsive-layout.css.ts` with
the skin CSS vars; extraLargeDesktop continues to use the existing
`calc((100vw - maxWidth) / 2)` formula
- Seeds all existing skins with 16/32/48/64 per the design spec; the
default (for custom skins) is also 16/32/48/64
Closes #1611
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Deploy preview for mistica-web ready!
Deployed with vercel-action |
|
Accessibility report ℹ️ You can run this locally by executing |
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
responsiveLayoutMargindesign token (from mistica-design#2662) to the skin type system and all known skinsResponsiveLayoutcomponent now reads side-margin values from the skin token instead of hardcoded constants, enabling per-brand marginsextraLargeDesktopbreakpoint continues to use the existingcalc((100vw - 1704px) / 2)centring formula (the token's"auto"semantic)Changes
Type system (
SpacingConfig):ResponsiveMarginValuestype{mobile, tablet, desktop, largeDesktop}: numberresponsiveLayoutMargin: ResponsiveMarginValuestoSpacingConfigToThemeTokensconditional to usekeyof T extends 'mobile' | 'desktop'so per-breakpoint token objects expand to individual CSS vars instead of collapsing to a single varSkin contract:
spacing.responsiveLayoutMargincontract entry with four CSS vars (one per breakpoint)Theme infrastructure:
theme-context-providerdetects the new token shape (via'largeDesktop' in values) and sets all four CSS vars directly; no media-query override is needed since breakpoint selection is handled in the CSS fileResponsiveLayout CSS:
marginValue.{mobile,tablet,desktop,largeDesktop}now reference the skin CSS vars; the hardcoded constants remain exported forsheet-common.tsxbackward compatibilityTest plan
tsc --noEmit)snackbar-test/cover-card-testare unrelated)Closes #1611
🤖 Generated with Claude Code