Repository navigation
fix(theme): formalize container padding tokens, prevent internal var access - #847
Merged
Merged
Conversation
…access Introduces --xds-container-padding as the public API for themes to adjust container (Card/Section) padding. Themes no longer need to reference internal --layout-padding-* CSS variables. Changes: - container.stylex.ts: Add useThemeDefault mode that cascades internal layout vars from --xds-container-padding with --spacing-4 fallback - XDSCard.tsx: Use theme default when no explicit padding prop - XDSSection.tsx: Same treatment - neutralTheme.ts: Replace 4 internal var overrides per component with single --xds-container-padding override The internal --layout-padding-* vars still exist for the Layout system's inner/outer padding split, but themes interact only with the public --xds-container-padding property. Closes #846 Co-authored-by: Navi <[email protected]>
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCard · View in Storybook
Layout · View in Storybook
Section · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. XDSLayout - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Contributor
Author
|
This is good but we should think about how documentation reflects this capability for our containers and ensure we have night watch cover this. |
cixzhang
added a commit
that referenced
this pull request
Mar 24, 2026
Add documentation for the --xds-container-padding CSS custom property introduced in PR #847. This is the public API for themes to adjust Card/Section padding, replacing direct access to internal --layout-padding-* variables. Updated: - packages/cli/docs/theme.md — new 'Container Padding Override' section - packages/cli/docs/tokens.md — new 'Component CSS Custom Properties' section - packages/core/src/theme/README.md — new component-level CSS properties table Closes #846
This was referenced Mar 24, 2026
Merged
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
…access (#847) Introduces --xds-container-padding as the public API for themes to adjust container (Card/Section) padding. Themes no longer need to reference internal --layout-padding-* CSS variables. Changes: - container.stylex.ts: Add useThemeDefault mode that cascades internal layout vars from --xds-container-padding with --spacing-4 fallback - XDSCard.tsx: Use theme default when no explicit padding prop - XDSSection.tsx: Same treatment - neutralTheme.ts: Replace 4 internal var overrides per component with single --xds-container-padding override The internal --layout-padding-* vars still exist for the Layout system's inner/outer padding split, but themes interact only with the public --xds-container-padding property. Closes #846 Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…access (#847) Introduces --xds-container-padding as the public API for themes to adjust container (Card/Section) padding. Themes no longer need to reference internal --layout-padding-* CSS variables. Changes: - container.stylex.ts: Add useThemeDefault mode that cascades internal layout vars from --xds-container-padding with --spacing-4 fallback - XDSCard.tsx: Use theme default when no explicit padding prop - XDSSection.tsx: Same treatment - neutralTheme.ts: Replace 4 internal var overrides per component with single --xds-container-padding override The internal --layout-padding-* vars still exist for the Layout system's inner/outer padding split, but themes interact only with the public --xds-container-padding property. Closes #846 Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…access (#847) Introduces --xds-container-padding as the public API for themes to adjust container (Card/Section) padding. Themes no longer need to reference internal --layout-padding-* CSS variables. Changes: - container.stylex.ts: Add useThemeDefault mode that cascades internal layout vars from --xds-container-padding with --spacing-4 fallback - XDSCard.tsx: Use theme default when no explicit padding prop - XDSSection.tsx: Same treatment - neutralTheme.ts: Replace 4 internal var overrides per component with single --xds-container-padding override The internal --layout-padding-* vars still exist for the Layout system's inner/outer padding split, but themes interact only with the public --xds-container-padding property. Closes #846
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
Introduces
--xds-container-paddingas the public API for themes to adjust container (Card/Section) padding. Themes no longer need to reference internal--layout-padding-*CSS variables.Problem
The neutral theme was overriding internal CSS variable names (
--layout-padding-inner-x,--layout-padding-inner-y,--layout-padding-outer-x,--layout-padding-outer-y) to adjust Card and Section padding. These are implementation details — if core renames them, themes break silently.Solution
New public API:
--xds-container-paddingThemes set a single CSS custom property in component overrides:
How it works
container.stylex.ts: NewuseThemeDefaultmode cascades all six internal layout vars from--xds-container-paddingwith--spacing-4fallbackpaddingprop is provided, use theme default mode. Whenpaddingis explicitly set, override the theme.--xds-container-paddingoverrideWhat stays the same
--layout-padding-*vars still power the Layout system's inner/outer padding splitpaddingprop on Card/Section still works and overrides the themeTest plan
Closes #846