diff --git a/assets/sass/components/feature-discovery/_googlesitekit-category-filter-chips.scss b/assets/sass/components/feature-discovery/_googlesitekit-category-filter-chips.scss index 36019225057..c89c95f538a 100644 --- a/assets/sass/components/feature-discovery/_googlesitekit-category-filter-chips.scss +++ b/assets/sass/components/feature-discovery/_googlesitekit-category-filter-chips.scss @@ -19,7 +19,23 @@ .googlesitekit-plugin { .googlesitekit-category-filter-chips { - margin-top: 32px; + background-color: $c-base; + + // Padding gives the chips breathing room over the content scrolling + // beneath them while stuck; the margins offset it so the resting + // layout is unchanged. + margin-block: 24px -8px; + padding-block: 8px; + position: sticky; + + // Sits directly below the sticky feature discovery tab bar. + top: calc(var(--googlesitekit-feature-discovery-sticky-top) + var(--googlesitekit-feature-discovery-tab-bar-height)); + z-index: 10; + + body.googlesitekit-showing-feature-tour &, + body.googlesitekit-showing-tooltip & { + position: static; + } .googlesitekit-chip-multi-select { gap: 10px; diff --git a/assets/sass/components/feature-discovery/_googlesitekit-feature-discovery.scss b/assets/sass/components/feature-discovery/_googlesitekit-feature-discovery.scss index 64134888c2d..78e8e8cc7ac 100644 --- a/assets/sass/components/feature-discovery/_googlesitekit-feature-discovery.scss +++ b/assets/sass/components/feature-discovery/_googlesitekit-feature-discovery.scss @@ -26,6 +26,27 @@ --googlesitekit-feature-discovery-padding-m: 36px; --googlesitekit-feature-discovery-padding-l: 48px; } + + // The tab bar sticks directly below the sticky Site Kit header, and the + // All services category chips stick below the tab bar. Offsets match + // `.googlesitekit-navigation`, which sticks below the same header. + --googlesitekit-feature-discovery-sticky-top: 68px; + --googlesitekit-feature-discovery-tab-bar-height: 57px; // 56px tabs + 1px border. + + body.admin-bar & { + + @media (min-width: $width-tablet + 1 + px) { + --googlesitekit-feature-discovery-sticky-top: 114px; + } + + @media (min-width: $bp-wpAdminBarTablet) { + --googlesitekit-feature-discovery-sticky-top: 100px; + } + + @media (min-width: $width-desktop + 1 + px) { + --googlesitekit-feature-discovery-sticky-top: 116px; + } + } } .googlesitekit-feature-discovery__header { @@ -40,6 +61,18 @@ padding-inline: var(--googlesitekit-feature-discovery-padding-m); } + .googlesitekit-feature-discovery__tab-bar { + background-color: $c-base; + position: sticky; + top: var(--googlesitekit-feature-discovery-sticky-top); + z-index: 10; + + body.googlesitekit-showing-feature-tour &, + body.googlesitekit-showing-tooltip & { + position: static; + } + } + .googlesitekit-feature-discovery__content { min-block-size: 546px; padding-block: 0 var(--googlesitekit-feature-discovery-padding-l);