Skip to content

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

Closed
Marcosld wants to merge 5 commits into
masterfrom
light-implement/enable-responsive-layout-margin-token
Closed

feat(tokens): enable responsiveLayoutMargin token in ResponsiveLayout#1644
Marcosld wants to merge 5 commits into
masterfrom
light-implement/enable-responsive-layout-margin-token

Conversation

@Marcosld

@Marcosld Marcosld commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces the responsiveLayoutMargin design token (from mistica-design#2662) so ResponsiveLayout side margins can vary per brand instead of using hardcoded pixel constants
  • Imports the token values (and 15 new color tokens) from the mistica-design PR branch into all known skin files via the generate-design-tokens script
  • Fixes cyber-skin.tsx manually with the new token values

Changes

Type system (SpacingConfig):

  • Exports ResponsiveMarginValues type {mobile, tablet, desktop, largeDesktop}: number
  • Adds responsiveLayoutMargin: ResponsiveMarginValues to SpacingConfig
  • Fixes ToThemeTokens conditional to use keyof T extends 'mobile' | 'desktop' so four-key objects expand to individual CSS vars instead of collapsing to a single var (old check used structural subtyping which matched any superset of {mobile, desktop})

Skin contract:

  • Adds spacing.responsiveLayoutMargin contract entry with four CSS vars
  • Adds 15 new color token entries (backgroundSelected*, buttonLinkNeutral*, textLinkNeutral*) that arrived with the same mistica-design PR

Theme infrastructure:

  • ThemeContextProvider now merges defaultSpacing with theme.skin.spacing (was ??) so partial skin spacing always falls back to defaults
  • Adds a 'largeDesktop' in values guard in both spacing var memos to emit all four breakpoint vars directly

ResponsiveLayout CSS:

  • marginValue.{mobile,tablet,desktop,largeDesktop} now reference the skin CSS vars; extraLargeDesktop keeps its existing calc((100vw - 1704px) / 2) centring formula; hardcoded numeric constants remain exported for sheet-common.tsx

Import script:

  • Strips extraLargeDesktop: "auto" from responsiveLayoutMargin when generating skin files (it is a CSS semantic, not a pixel value)

Skin files:

  • Regenerated all 10 known skins via generate-design-tokens against mistica-design branch 2648-responsive-layout-update-app-50-vivo-new

Test plan

  • yarn tsc --noEmit exits 0
  • Visually verify ResponsiveLayout margins at each breakpoint for Movistar and Blau skins in Storybook
  • Confirm screenshot tests pass (margins should be unchanged — all skins use 16/32/48/64, same as the previous hardcoded values)

Closes #1611

🤖 Generated with Claude Code

Marcosld and others added 4 commits July 9, 2026 08:47
…t, defaults

- Exports `ResponsiveMarginValues` type `{mobile, tablet, desktop, largeDesktop}`
  from `src/skins/types/index.tsx`
- Adds `responsiveLayoutMargin: ResponsiveMarginValues` (required) to `SpacingConfig`
- Fixes `ToThemeTokens` conditional to use `keyof T extends 'mobile' | 'desktop'`
  so four-key objects expand to per-key CSS vars instead of collapsing to a string
- Adds `responsiveLayoutMargin` contract entry to `skin-contract.css.ts`
- Seeds `defaultSpacing` in `defaults.tsx` with 16/32/48/64

Refs #1611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vars

- Merges `defaultSpacing` with `theme.skin.spacing` so skins that don't
  yet include `responsiveLayoutMargin` still get the default values
- Adds a `'largeDesktop' in values` guard in both `spacingDesktopVars`
  and `spacingMobileVars` to emit all four breakpoint vars directly,
  bypassing the top/right/bottom/left path used by padding tokens

Refs #1611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the four hardcoded pixel constants in `marginValue` with
`skinVars.spacing.responsiveLayoutMargin.*` CSS var references.
The `extraLargeDesktop` centring formula and the exported numeric
constants (used by `sheet-common.tsx`) are unchanged.

Refs #1611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…import script

The mistica-design token JSON includes `extraLargeDesktop: "auto"` in
`responsiveLayoutMargin.value`. This field is a CSS semantic (use the
centring formula) and must not be emitted as a skin value — it would
break the `ResponsiveMarginValues` TypeScript type. Strip it when
generating skin files; the formula stays hardcoded in responsive-layout.css.ts.

Refs #1611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Marcosld Marcosld added the AI AI Generated label Jul 9, 2026
Runs the generate-design-tokens script against branch
2648-responsive-layout-update-app-50-vivo-new to regenerate all known
skin files with the new responsiveLayoutMargin token and 15 new color
tokens (backgroundSelected*, buttonLinkNeutral*, textLinkNeutral*).

- All 10 generated skins now include responsiveLayoutMargin: {mobile: 16,
  tablet: 32, desktop: 48, largeDesktop: 64}
- skin-contract.css.ts updated with 15 new color token entries
- cyber-skin.tsx updated manually with responsiveLayoutMargin and 15 new
  color tokens

Closes #1611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Size stats

master this branch diff
Total JS 17 MB 17 MB +22.9 kB
JS without icons 2.09 MB 2.11 MB +22.9 kB
Lib overhead 96.3 kB 99.6 kB +3.3 kB
Lib overhead (gzip) 21.1 kB 21.6 kB +485 B

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-nhfy0fynv-flows-projects-65bb050e.vercel.app
Latest Commit:934d8eb

Deployed with vercel-action

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Accessibility report
✔️ No issues found

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

@Marcosld

Marcosld commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Closing — reverting implementation to rethink approach.

@Marcosld Marcosld closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI Generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable responsiveLayoutMargin token

1 participant