Repository navigation
fix(AppShell): apply navAreaStyle to header wrapper in all height modes - #2464
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🚀 Vercel Preview Deployment
|
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: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
8bb67f0 to
853bdb7
Compare
The elevated variant's root already paints --color-background-body. Both the header and sidenav should be transparent, letting the root show through — same as the section variant. PR #597 (d0d8fca) grouped 'elevated' with 'wash' in the navAreaStyle condition, giving both an explicit navAreaWash background. This was unnecessary for elevated (root already has that color) and caused the header/sidenav to paint on separate layers, which created subtle rendering inconsistencies between the two nav areas. Fix: remove 'elevated' from the navAreaStyle condition so both header and sidenav are transparent. The stickyBgStyle fallback (for auto mode scroll opacity) now correctly uses navAreaWash for elevated instead of navAreaSurface.
853bdb7 to
d1f10ac
Compare
|
Both header render sites dropped In auto height mode, the sticky header relied on If that's not intended, re-adding it to both sites should cover it: stylex.props(navAreaStyle, isAuto && styles.headerSticky, isAuto && stickyBgStyle)The at-rest transparency fix itself looks right. |
| xdsClassName('app-shell-header', {variant}), | ||
| stylex.props(isAuto && styles.headerSticky, isAuto && stickyBgStyle), | ||
| stylex.props( | ||
| navAreaStyle, |
There was a problem hiding this comment.
Did we need to include it here? There were some issues I ran into some time ago around theming these for sticky. I think if it's not sticky we shouldn't need this extra style but curious what you ran into.
| xdsClassName('app-shell-header', {variant}), | ||
| stylex.props(isAuto && styles.headerSticky, isAuto && stickyBgStyle), | ||
| stylex.props( | ||
| navAreaStyle, |
cixzhang
left a comment
There was a problem hiding this comment.
Hmm wasn't sure if we needed these navAreaStyles so left some comments there. But overall looks good
The header wrapper only received a background in auto mode (via stickyBgStyle for scroll opacity), while the sidenav panel always received navAreaStyle. In fill mode (the default), the header was transparent — relying on the root background showing through. This caused a visible color mismatch between the top nav and side nav in the elevated variant due to compositing layer differences. Fix: apply navAreaStyle unconditionally to the header wrapper, matching the sidenav panel. Both nav areas now paint their own background layer identically in all height modes. Introduced in PR #597 (d0d8fca) which added navAreaStyle to the panel but only added it to the header for auto mode in PR #615.
d179b7e to
f103d3a
Compare
The docsite's translucent top-nav effect (backdrop-filter blur + 80% transparent background) used bare .xds-top-nav and .xds-layout-header selectors. These leaked into nested AppShells rendered inside component examples and template previews, causing their top navs to get the frosted glass treatment unintentionally. Scope all affected rules with :not(.xds-app-shell .xds-app-shell) so they only match the outermost (page-level) shell. Nested shells inside the content area render with their normal opaque backgrounds.
The previous scoping put the nested-shell guard on the outer .xds-app-shell (`.xds-app-shell:not(.xds-app-shell .xds-app-shell) > .xds-layout .xds-top-nav`), but the trailing .xds-top-nav was an unrestricted descendant — a nested AppShell's top nav is still a descendant of the outer layout, so the frost leaked into component examples and templates. Move the guard onto the styled element itself via `:where(:not(.xds-app-shell .xds-app-shell *))`. Any nav with two AppShell ancestors is excluded and keeps its solid navAreaStyle background, staying seamless with its sidenav. :where() keeps specificity at (0,1,0) so the home-page, nav-mode, and theme-preview overrides still win unchanged.
|
Follow-up commit: the frosted top-nav scoping wasn't actually working. Bug in the prior scoping: the guard was on the outer shell — Fix: move the guard onto the styled element itself via Verified the selector matching with jsdom: old selector matched both outer + nested navs; new selector matches outer only (and a standalone TopNav like the theme-preview faux nav still frosts as intended). |
…es (#2464) * fix(AppShell): remove explicit navAreaStyle from elevated variant The elevated variant's root already paints --color-background-body. Both the header and sidenav should be transparent, letting the root show through — same as the section variant. PR #597 (d78a5d0) grouped 'elevated' with 'wash' in the navAreaStyle condition, giving both an explicit navAreaWash background. This was unnecessary for elevated (root already has that color) and caused the header/sidenav to paint on separate layers, which created subtle rendering inconsistencies between the two nav areas. Fix: remove 'elevated' from the navAreaStyle condition so both header and sidenav are transparent. The stickyBgStyle fallback (for auto mode scroll opacity) now correctly uses navAreaWash for elevated instead of navAreaSurface. * fix(AppShell): apply navAreaStyle to header wrapper in all height modes The header wrapper only received a background in auto mode (via stickyBgStyle for scroll opacity), while the sidenav panel always received navAreaStyle. In fill mode (the default), the header was transparent — relying on the root background showing through. This caused a visible color mismatch between the top nav and side nav in the elevated variant due to compositing layer differences. Fix: apply navAreaStyle unconditionally to the header wrapper, matching the sidenav panel. Both nav areas now paint their own background layer identically in all height modes. Introduced in PR #597 (d78a5d0) which added navAreaStyle to the panel but only added it to the header for auto mode in PR #615. * fix(docsite): scope frosted top-nav CSS to outermost shell only The docsite's translucent top-nav effect (backdrop-filter blur + 80% transparent background) used bare .xds-top-nav and .xds-layout-header selectors. These leaked into nested AppShells rendered inside component examples and template previews, causing their top navs to get the frosted glass treatment unintentionally. Scope all affected rules with :not(.xds-app-shell .xds-app-shell) so they only match the outermost (page-level) shell. Nested shells inside the content area render with their normal opaque backgrounds. * fix(docsite): correctly scope frosted top-nav to outermost AppShell The previous scoping put the nested-shell guard on the outer .xds-app-shell (`.xds-app-shell:not(.xds-app-shell .xds-app-shell) > .xds-layout .xds-top-nav`), but the trailing .xds-top-nav was an unrestricted descendant — a nested AppShell's top nav is still a descendant of the outer layout, so the frost leaked into component examples and templates. Move the guard onto the styled element itself via `:where(:not(.xds-app-shell .xds-app-shell *))`. Any nav with two AppShell ancestors is excluded and keeps its solid navAreaStyle background, staying seamless with its sidenav. :where() keeps specificity at (0,1,0) so the home-page, nav-mode, and theme-preview overrides still win unchanged.
…es (#2464) * fix(AppShell): remove explicit navAreaStyle from elevated variant The elevated variant's root already paints --color-background-body. Both the header and sidenav should be transparent, letting the root show through — same as the section variant. PR #597 (9237ea5) grouped 'elevated' with 'wash' in the navAreaStyle condition, giving both an explicit navAreaWash background. This was unnecessary for elevated (root already has that color) and caused the header/sidenav to paint on separate layers, which created subtle rendering inconsistencies between the two nav areas. Fix: remove 'elevated' from the navAreaStyle condition so both header and sidenav are transparent. The stickyBgStyle fallback (for auto mode scroll opacity) now correctly uses navAreaWash for elevated instead of navAreaSurface. * fix(AppShell): apply navAreaStyle to header wrapper in all height modes The header wrapper only received a background in auto mode (via stickyBgStyle for scroll opacity), while the sidenav panel always received navAreaStyle. In fill mode (the default), the header was transparent — relying on the root background showing through. This caused a visible color mismatch between the top nav and side nav in the elevated variant due to compositing layer differences. Fix: apply navAreaStyle unconditionally to the header wrapper, matching the sidenav panel. Both nav areas now paint their own background layer identically in all height modes. Introduced in PR #597 (9237ea5) which added navAreaStyle to the panel but only added it to the header for auto mode in PR #615. * fix(docsite): scope frosted top-nav CSS to outermost shell only The docsite's translucent top-nav effect (backdrop-filter blur + 80% transparent background) used bare .xds-top-nav and .xds-layout-header selectors. These leaked into nested AppShells rendered inside component examples and template previews, causing their top navs to get the frosted glass treatment unintentionally. Scope all affected rules with :not(.xds-app-shell .xds-app-shell) so they only match the outermost (page-level) shell. Nested shells inside the content area render with their normal opaque backgrounds. * fix(docsite): correctly scope frosted top-nav to outermost AppShell The previous scoping put the nested-shell guard on the outer .xds-app-shell (`.xds-app-shell:not(.xds-app-shell .xds-app-shell) > .xds-layout .xds-top-nav`), but the trailing .xds-top-nav was an unrestricted descendant — a nested AppShell's top nav is still a descendant of the outer layout, so the frost leaked into component examples and templates. Move the guard onto the styled element itself via `:where(:not(.xds-app-shell .xds-app-shell *))`. Any nav with two AppShell ancestors is excluded and keeps its solid navAreaStyle background, staying seamless with its sidenav. :where() keeps specificity at (0,1,0) so the home-page, nav-mode, and theme-preview overrides still win unchanged.
Problem
The top nav and side nav render with subtly different background colors in the
elevatedvariant (the default).Root Cause
The sidenav panel always receives
navAreaStyle(explicit--color-background-body):But the header wrapper only received a background in auto height mode:
In the default fill mode, the header wrapper was transparent — relying on the root shell's background showing through. The sidenav painted its own layer explicitly. This mismatch caused the browser to composite them differently (sub-pixel rendering, layer boundaries from
isolation: isolateon the elevated content backdrop), producing a visible color seam.Introduced across PR #597 (
d0d8fca) which addednavAreaStyleto the panel, and PR #615 (d0fda31) which only added it to the header in auto mode for sticky scroll opacity.Fix
Apply
navAreaStyleto the header wrapper unconditionally:Both nav areas now paint their own background layer identically in all height modes.
Testing