Repository navigation
feat: CSS layer ordering for dist path theming - #806
Merged
Merged
Conversation
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 18 accessibility violation(s) found — 1 critical, 15 serious, 2 moderate. XDSBanner - 1 issue(s)
XDSCalendar - 1 issue(s)
XDSCheckboxInput - 1 issue(s)
XDSCodeBlock - 2 issue(s)
XDSCodeEditor - 3 issue(s)
XDSHeading - 1 issue(s)
XDSIcon - 1 issue(s)
XDSLayout - 1 issue(s)
XDSList - 1 issue(s)
XDSPagination - 1 issue(s)
XDSSideNav - 1 issue(s)
XDSTabList - 1 issue(s)
Selection - 1 issue(s)
XDSText - 1 issue(s)
XDSToken - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
marked this pull request as draft
March 21, 2026 22:37
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
from
March 21, 2026 23:25
aa64cb4 to
ea0cb44
Compare
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
2 times, most recently
from
March 22, 2026 00:34
e940fc0 to
6919354
Compare
cixzhang
marked this pull request as ready for review
March 22, 2026 03:05
cixzhang
marked this pull request as draft
March 22, 2026 03:09
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
from
March 22, 2026 04:16
8233214 to
f941f9b
Compare
This was referenced Mar 22, 2026
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
from
March 22, 2026 07:10
f941f9b to
2942729
Compare
cixzhang
pushed a commit
that referenced
this pull request
Mar 22, 2026
With splitting: false, tsup inlines all code into each entry point. Two fixes needed: 1. Barrel index.ts files need 'use client' since they're the entry points 2. Post-build script (fix-use-client-dist.mjs) moves the directive to line 1 in dist files — tsup/babel may insert helpers before it Fixes sandbox build failure in #806.
cixzhang
added a commit
that referenced
this pull request
Mar 22, 2026
With splitting: false, tsup inlines all code into each entry point. Two fixes needed: 1. Barrel index.ts files need 'use client' since they're the entry points 2. Post-build script (fix-use-client-dist.mjs) moves the directive to line 1 in dist files — tsup/babel may insert helpers before it Fixes sandbox build failure in #806. Co-authored-by: Navi <[email protected]>
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
from
March 22, 2026 08:36
2942729 to
91e6751
Compare
added 11 commits
March 22, 2026 16:05
Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) to avoid CSS sub-layer nesting — @layer xds.theme would be a sub-layer of @layer xds, which has lower priority than its parent. Flat layers with declaration order give us the right cascade. Storybook switches to dist path (requires yarn build first) so the layer model is exercised. Brutalist theme adds a borderRadius override on button (9999px pill) for visual verification — if layers work, brutalist buttons are pill-shaped; if broken, they stay sharp. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Storybook: dist path + layer order declaration - Brutalist: pill button override for visual verification - Sandbox: layer model documentation
Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) because CSS @layer xds.theme would be a sub-layer of @layer xds — sub-layers have lower priority than their parent's direct rules. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Brutalist: pill button override for visual verification - Sandbox: layer model documentation Storybook stays on source path (preserves autodocs). Verified via local yarn build + storybook with dist — pill buttons confirm theme layer wins over base.
Replace hand-rolled sidebar with XDSAppShell + XDSSideNav. Add theme selector (default/neutral/brutalist) and dark mode toggle to the sidebar, making the sandbox a proper verification environment for the CSS layer model. - Providers: theme context with selection + mode state - SandboxNav: XDSSideNav with page links + theme/mode controls - SandboxTopNav: XDSTopNav header - Layout: XDSAppShell wrapping sandbox pages - Import all three theme CSS files (scoped via @scope, only active applies) - Remove hand-rolled Sidebar.tsx
Sandbox now uses pre-built dist CSS for @xds/core and themes: - PostCSS only compiles sandbox page files (not core/theme source) - useCSSLayers: false for page styles (unlayered = consumer behavior) - next.config: stop transpiling @xds/core (uses dist) Move ThemeEditor from Storybook to sandbox: - New page at /pages/theme-editor/ - Storybook is now component docs only - Sandbox is for theme experimentation + layer verification Add Theme Editor to sandbox nav.
…tInput value
Batch fix for stale API usages in theme-editor sandbox page:
- Slider: minValue/maxValue → min/max
- Dialog: onClose → onOpenChange, remove title prop
- Stack: gap='md' → gap={3} (SpacingStep is numeric)
- TextInput in dialog: add required value prop
added 7 commits
March 22, 2026 16:05
…ontent, Badge accent → info
Built core + themes locally with split DTS, ran tsc on sandbox — found
and fixed the last type error (TypographyCategoryValue cast).
All previous fixes from CI iterations are included in the rebase:
- padding='lg' → padding={4}
- getRowKey removed
- Badge variant/sentiment → valid variants
- TextInput/Switch/Checkbox value props
- Slider min/max, Dialog onOpenChange
- Stack direction, Avatar sizes
- typeScale → typography.scale
- Typed callback params
- Banner variant=educational → status=info
tsc --noEmit passes clean.
cixzhang
force-pushed
the
navi/feat/css-layer-ordering
branch
from
March 22, 2026 16:07
8da161b to
c507ff9
Compare
cixzhang
marked this pull request as ready for review
March 22, 2026 17:20
josephfarina
added a commit
that referenced
this pull request
Mar 23, 2026
reset.css was renamed from @layer reset to @layer xds-reset in #806, but the Storybook layer order declaration still referenced the old name. Since xds-reset wasn't in the declaration, CSS treated it as undeclared and gave it highest priority, causing the reset's border-width: 0 to stomp component borders (TextInput, Selector, etc.). Also adds xds-theme to the layer order so runtime theme injection slots into the right position.
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
With splitting: false, tsup inlines all code into each entry point. Two fixes needed: 1. Barrel index.ts files need 'use client' since they're the entry points 2. Post-build script (fix-use-client-dist.mjs) moves the directive to line 1 in dist files — tsup/babel may insert helpers before it Fixes sandbox build failure in #806. Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
* feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) to avoid CSS sub-layer nesting — @layer xds.theme would be a sub-layer of @layer xds, which has lower priority than its parent. Flat layers with declaration order give us the right cascade. Storybook switches to dist path (requires yarn build first) so the layer model is exercised. Brutalist theme adds a borderRadius override on button (9999px pill) for visual verification — if layers work, brutalist buttons are pill-shaped; if broken, they stay sharp. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Storybook: dist path + layer order declaration - Brutalist: pill button override for visual verification - Sandbox: layer model documentation * feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) because CSS @layer xds.theme would be a sub-layer of @layer xds — sub-layers have lower priority than their parent's direct rules. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Brutalist: pill button override for visual verification - Sandbox: layer model documentation Storybook stays on source path (preserves autodocs). Verified via local yarn build + storybook with dist — pill buttons confirm theme layer wins over base. * feat(sandbox): AppShell + theme switching for dist path verification Replace hand-rolled sidebar with XDSAppShell + XDSSideNav. Add theme selector (default/neutral/brutalist) and dark mode toggle to the sidebar, making the sandbox a proper verification environment for the CSS layer model. - Providers: theme context with selection + mode state - SandboxNav: XDSSideNav with page links + theme/mode controls - SandboxTopNav: XDSTopNav header - Layout: XDSAppShell wrapping sandbox pages - Import all three theme CSS files (scoped via @scope, only active applies) - Remove hand-rolled Sidebar.tsx * feat(sandbox): switch to dist path + move ThemeEditor from Storybook Sandbox now uses pre-built dist CSS for @xds/core and themes: - PostCSS only compiles sandbox page files (not core/theme source) - useCSSLayers: false for page styles (unlayered = consumer behavior) - next.config: stop transpiling @xds/core (uses dist) Move ThemeEditor from Storybook to sandbox: - New page at /pages/theme-editor/ - Storybook is now component docs only - Sandbox is for theme experimentation + layer verification Add Theme Editor to sandbox nav. * fix(sandbox): use numeric SpacingStep for Card padding * fix(sandbox): remove getRowKey (not in XDSTable API) * fix(sandbox): fix Badge variant/sentiment props to match current API * fix(sandbox): fix TextInput value, Switch/Checkbox isSelected→value * fix(sandbox): fix Slider min/max, Dialog onOpenChange, Stack gap, TextInput value Batch fix for stale API usages in theme-editor sandbox page: - Slider: minValue/maxValue → min/max - Dialog: onClose → onOpenChange, remove title prop - Stack: gap='md' → gap={3} (SpacingStep is numeric) - TextInput in dialog: add required value prop * fix(sandbox): close XDSDialog JSX tag * fix(sandbox): Avatar size sm/md/lg → small/medium/large, remove Table size * fix(sandbox): add direction to XDSStack * fix(sandbox): Banner variant=educational → status=info, action → endContent, Badge accent → info * fix(sandbox): add required label to ProgressBar * fix(sandbox): type allDefaults as Record<string, string> * fix(sandbox): typeScale → typography.scale in defineTheme call * fix(sandbox): type all callback params, fix typeScale → typography.scale * fix(sandbox): fix all type errors in theme-editor Built core + themes locally with split DTS, ran tsc on sandbox — found and fixed the last type error (TypographyCategoryValue cast). All previous fixes from CI iterations are included in the rebase: - padding='lg' → padding={4} - getRowKey removed - Badge variant/sentiment → valid variants - TextInput/Switch/Checkbox value props - Slider min/max, Dialog onOpenChange - Stack direction, Avatar sizes - typeScale → typography.scale - Typed callback params - Banner variant=educational → status=info tsc --noEmit passes clean. --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
With splitting: false, tsup inlines all code into each entry point. Two fixes needed: 1. Barrel index.ts files need 'use client' since they're the entry points 2. Post-build script (fix-use-client-dist.mjs) moves the directive to line 1 in dist files — tsup/babel may insert helpers before it Fixes sandbox build failure in #806. Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) to avoid CSS sub-layer nesting — @layer xds.theme would be a sub-layer of @layer xds, which has lower priority than its parent. Flat layers with declaration order give us the right cascade. Storybook switches to dist path (requires yarn build first) so the layer model is exercised. Brutalist theme adds a borderRadius override on button (9999px pill) for visual verification — if layers work, brutalist buttons are pill-shaped; if broken, they stay sharp. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Storybook: dist path + layer order declaration - Brutalist: pill button override for visual verification - Sandbox: layer model documentation * feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) because CSS @layer xds.theme would be a sub-layer of @layer xds — sub-layers have lower priority than their parent's direct rules. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Brutalist: pill button override for visual verification - Sandbox: layer model documentation Storybook stays on source path (preserves autodocs). Verified via local yarn build + storybook with dist — pill buttons confirm theme layer wins over base. * feat(sandbox): AppShell + theme switching for dist path verification Replace hand-rolled sidebar with XDSAppShell + XDSSideNav. Add theme selector (default/neutral/brutalist) and dark mode toggle to the sidebar, making the sandbox a proper verification environment for the CSS layer model. - Providers: theme context with selection + mode state - SandboxNav: XDSSideNav with page links + theme/mode controls - SandboxTopNav: XDSTopNav header - Layout: XDSAppShell wrapping sandbox pages - Import all three theme CSS files (scoped via @scope, only active applies) - Remove hand-rolled Sidebar.tsx * feat(sandbox): switch to dist path + move ThemeEditor from Storybook Sandbox now uses pre-built dist CSS for @xds/core and themes: - PostCSS only compiles sandbox page files (not core/theme source) - useCSSLayers: false for page styles (unlayered = consumer behavior) - next.config: stop transpiling @xds/core (uses dist) Move ThemeEditor from Storybook to sandbox: - New page at /pages/theme-editor/ - Storybook is now component docs only - Sandbox is for theme experimentation + layer verification Add Theme Editor to sandbox nav. * fix(sandbox): use numeric SpacingStep for Card padding * fix(sandbox): remove getRowKey (not in XDSTable API) * fix(sandbox): fix Badge variant/sentiment props to match current API * fix(sandbox): fix TextInput value, Switch/Checkbox isSelected→value * fix(sandbox): fix Slider min/max, Dialog onOpenChange, Stack gap, TextInput value Batch fix for stale API usages in theme-editor sandbox page: - Slider: minValue/maxValue → min/max - Dialog: onClose → onOpenChange, remove title prop - Stack: gap='md' → gap={3} (SpacingStep is numeric) - TextInput in dialog: add required value prop * fix(sandbox): close XDSDialog JSX tag * fix(sandbox): Avatar size sm/md/lg → small/medium/large, remove Table size * fix(sandbox): add direction to XDSStack * fix(sandbox): Banner variant=educational → status=info, action → endContent, Badge accent → info * fix(sandbox): add required label to ProgressBar * fix(sandbox): type allDefaults as Record<string, string> * fix(sandbox): typeScale → typography.scale in defineTheme call * fix(sandbox): type all callback params, fix typeScale → typography.scale * fix(sandbox): fix all type errors in theme-editor Built core + themes locally with split DTS, ran tsc on sandbox — found and fixed the last type error (TypographyCategoryValue cast). All previous fixes from CI iterations are included in the rebase: - padding='lg' → padding={4} - getRowKey removed - Badge variant/sentiment → valid variants - TextInput/Switch/Checkbox value props - Slider min/max, Dialog onOpenChange - Stack direction, Avatar sizes - typeScale → typography.scale - Typed callback params - Banner variant=educational → status=info tsc --noEmit passes clean. --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
With splitting: false, tsup inlines all code into each entry point. Two fixes needed: 1. Barrel index.ts files need 'use client' since they're the entry points 2. Post-build script (fix-use-client-dist.mjs) moves the directive to line 1 in dist files — tsup/babel may insert helpers before it Fixes sandbox build failure in #806.
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) to avoid CSS sub-layer nesting — @layer xds.theme would be a sub-layer of @layer xds, which has lower priority than its parent. Flat layers with declaration order give us the right cascade. Storybook switches to dist path (requires yarn build first) so the layer model is exercised. Brutalist theme adds a borderRadius override on button (9999px pill) for visual verification — if layers work, brutalist buttons are pill-shaped; if broken, they stay sharp. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Storybook: dist path + layer order declaration - Brutalist: pill button override for visual verification - Sandbox: layer model documentation * feat: CSS layer ordering for dist path theming Establishes a 3-layer CSS model so theme overrides win over base component styles without !important: 1. xds-reset — reset styles (lowest priority) 2. xds-base — component styles from StyleX build 3. xds-theme — theme token + component overrides Uses hyphenated names (xds-base, not xds.base) because CSS @layer xds.theme would be a sub-layer of @layer xds — sub-layers have lower priority than their parent's direct rules. Changes: - reset.css: @layer reset → @layer xds-reset - build-css.mjs: @layer xds → @layer xds-base - build-theme.mjs: @layer xds.theme → @layer xds-theme - XDSTheme.tsx: runtime injection uses @layer xds-theme - Brutalist: pill button override for visual verification - Sandbox: layer model documentation Storybook stays on source path (preserves autodocs). Verified via local yarn build + storybook with dist — pill buttons confirm theme layer wins over base. * feat(sandbox): AppShell + theme switching for dist path verification Replace hand-rolled sidebar with XDSAppShell + XDSSideNav. Add theme selector (default/neutral/brutalist) and dark mode toggle to the sidebar, making the sandbox a proper verification environment for the CSS layer model. - Providers: theme context with selection + mode state - SandboxNav: XDSSideNav with page links + theme/mode controls - SandboxTopNav: XDSTopNav header - Layout: XDSAppShell wrapping sandbox pages - Import all three theme CSS files (scoped via @scope, only active applies) - Remove hand-rolled Sidebar.tsx * feat(sandbox): switch to dist path + move ThemeEditor from Storybook Sandbox now uses pre-built dist CSS for @xds/core and themes: - PostCSS only compiles sandbox page files (not core/theme source) - useCSSLayers: false for page styles (unlayered = consumer behavior) - next.config: stop transpiling @xds/core (uses dist) Move ThemeEditor from Storybook to sandbox: - New page at /pages/theme-editor/ - Storybook is now component docs only - Sandbox is for theme experimentation + layer verification Add Theme Editor to sandbox nav. * fix(sandbox): use numeric SpacingStep for Card padding * fix(sandbox): remove getRowKey (not in XDSTable API) * fix(sandbox): fix Badge variant/sentiment props to match current API * fix(sandbox): fix TextInput value, Switch/Checkbox isSelected→value * fix(sandbox): fix Slider min/max, Dialog onOpenChange, Stack gap, TextInput value Batch fix for stale API usages in theme-editor sandbox page: - Slider: minValue/maxValue → min/max - Dialog: onClose → onOpenChange, remove title prop - Stack: gap='md' → gap={3} (SpacingStep is numeric) - TextInput in dialog: add required value prop * fix(sandbox): close XDSDialog JSX tag * fix(sandbox): Avatar size sm/md/lg → small/medium/large, remove Table size * fix(sandbox): add direction to XDSStack * fix(sandbox): Banner variant=educational → status=info, action → endContent, Badge accent → info * fix(sandbox): add required label to ProgressBar * fix(sandbox): type allDefaults as Record<string, string> * fix(sandbox): typeScale → typography.scale in defineTheme call * fix(sandbox): type all callback params, fix typeScale → typography.scale * fix(sandbox): fix all type errors in theme-editor Built core + themes locally with split DTS, ran tsc on sandbox — found and fixed the last type error (TypographyCategoryValue cast). All previous fixes from CI iterations are included in the rebase: - padding='lg' → padding={4} - getRowKey removed - Badge variant/sentiment → valid variants - TextInput/Switch/Checkbox value props - Slider min/max, Dialog onOpenChange - Stack direction, Avatar sizes - typeScale → typography.scale - Typed callback params - Banner variant=educational → status=info tsc --noEmit passes clean. ---------
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
Establishes CSS layer ordering for the dist path so theme overrides win over component styles by cascade, not specificity. Also migrates the sandbox app to use the dist path with a full Theme Editor page.
CSS Layer Model
xds.reset— reset styles (lowest priority)xds.core.base— component styles from StyleXxds.theme— theme token + component overrides (wins over base)Product/consumer styles sit unlayered and naturally win over all XDS layers — no
!importantneeded.Sandbox: Dist Path + Theme Editor
Migrates the sandbox from importing source to importing from the dist path (
@xds/core/Button, etc.). Adds a Theme Editor page with:defineThemecodeChanges
Core infrastructure:
reset.css:@layer reset→@layer xds.resetstorybook/main.ts: layer declaration updatedbuild-css.mjsuses@layer xds.core.base,build-theme.mjsuses@layer xds.theme,XDSTheme.tsxruntime uses@layer xds.theme— all correct, no changes neededSandbox:
layout.tsx: usesXDSAppShellfrom dist with layer importsshell-lab/page.tsx: shell configuration playgroundtheme-editor/page.tsx: full theme editor with live previewcontainer, numericSpacingStep,onOpenChange,typography.scale, etc.)