Skip to content

feat(tokens): enable responsiveLayoutMargin token in ResponsiveLayout#1637

Closed
Marcosld wants to merge 1 commit into
masterfrom
feat/responsive-layout-margin-token-new
Closed

feat(tokens): enable responsiveLayoutMargin token in ResponsiveLayout#1637
Marcosld wants to merge 1 commit into
masterfrom
feat/responsive-layout-margin-token-new

Conversation

@Marcosld

@Marcosld Marcosld commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds the responsiveLayoutMargin design token (from mistica-design#2662) to the skin type system and all known skins
  • The ResponsiveLayout component now reads side-margin values from the skin token instead of hardcoded constants, enabling per-brand margins
  • The extraLargeDesktop breakpoint continues to use the existing calc((100vw - 1704px) / 2) centring formula (the token's "auto" semantic)

Changes

Type system (SpacingConfig):

  • Added ResponsiveMarginValues type {mobile, tablet, desktop, largeDesktop}: number
  • Added responsiveLayoutMargin: ResponsiveMarginValues to SpacingConfig
  • Fixed ToThemeTokens conditional to use keyof T extends 'mobile' | 'desktop' so per-breakpoint token objects expand to individual CSS vars instead of collapsing to a single var

Skin contract:

  • spacing.responsiveLayoutMargin contract entry with four CSS vars (one per breakpoint)
  • All skins seeded with 16 / 32 / 48 / 64 per the design spec

Theme infrastructure:

  • theme-context-provider detects 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 file

ResponsiveLayout CSS:

  • marginValue.{mobile,tablet,desktop,largeDesktop} now reference the skin CSS vars; the hardcoded constants remain exported for sheet-common.tsx backward compatibility

Test plan

  • TypeScript passes (tsc --noEmit)
  • Existing unit tests pass (pre-existing failures in snackbar-test / cover-card-test are unrelated)
  • Visually verify that ResponsiveLayout margins match the design spec at each breakpoint for a few skins

Closes #1611

🤖 Generated with Claude Code

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>
@Marcosld Marcosld closed this Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-c4l0or928-flows-projects-65bb050e.vercel.app
Latest Commit:502c523

Deployed with vercel-action

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable responsiveLayoutMargin token

1 participant