diff --git a/CODEOWNERS b/CODEOWNERS index f90a03e88..9cfcd06d5 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -30,9 +30,9 @@ guides/security/passkey-reauthentication/ @agektmr guides/security/passkey-registration/ @agektmr guides/security/passkeys/ @agektmr # Owned via feature "container-scroll-state-queries" -guides/ui-atoms/context-sensitive-sticky-headers/ @bramus guides/ui-atoms/scroll-position-aware-elements/ @bramus guides/ui-atoms/scrollability-affordance-hints/ @bramus +guides/ui-atoms/state-aware-sticky-headers/ @bramus # Owned via group "scrolling" guides/ui-atoms/carousel-slide-effects/ @bramus guides/ui-atoms/pull-to-reveal/ @bramus diff --git a/README.md b/README.md index 46054f2d5..051a8bf9f 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro
-130 real-world developer use cases +131 real-world developer use cases

accessibility

@@ -252,6 +252,7 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro - **[scroll-progress-indicator](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/scroll-progress-indicator.md)**: Create a scroll progress bar, stepped progress tracker, or any visual affordance that communicates how far through a page or section the user has scrolled. - **[scrollability-affordance-hints](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/scrollability-affordance-hints.md)**: Build scroll-shadow overlays, gradient fades, or directional arrow indicators that appear only when there's actually more content to scroll to in that direction. - **[shrinking-header-on-scroll](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/shrinking-header-on-scroll.md)**: Smoothly animate a fixed header or full-page cover on scroll to dynamically shrink, gain shadows, and transform its layout over a predefined scroll distance. +- **[state-aware-sticky-headers](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/state-aware-sticky-headers.md)**: Build sticky section headers or navbars that visually transform when they're actually "stuck" at the top, changing their color scheme or gaining a shadow.

ui-behaviors

diff --git a/guides/features-and-use-cases.md b/guides/features-and-use-cases.md index 4a6076495..e541f9eb3 100644 --- a/guides/features-and-use-cases.md +++ b/guides/features-and-use-cases.md @@ -45,7 +45,7 @@ │ └── size-aware-styling ├── container-scroll-state-queries │ ├── carousel-snap-highlights -│ ├── context-sensitive-sticky-headers +│ ├── state-aware-sticky-headers │ ├── scroll-position-aware-elements │ └── scrollability-affordance-hints ├── container-style-queries diff --git a/guides/ui-atoms/context-sensitive-sticky-headers/expectations.md b/guides/ui-atoms/context-sensitive-sticky-headers/expectations.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/guides/ui-atoms/context-sensitive-sticky-headers/guide.md b/guides/ui-atoms/context-sensitive-sticky-headers/guide.md deleted file mode 100644 index 0a3fa09e8..000000000 --- a/guides/ui-atoms/context-sensitive-sticky-headers/guide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -name: context-sensitive-sticky-headers -description: Build sticky section headers or navbars that visually transform when they're actually "stuck" at the top, collapsing, changing their color scheme, gaining a shadow, or switching to a more compact layout. -web-feature-ids: - - container-scroll-state-queries ---- diff --git a/guides/ui-atoms/context-sensitive-sticky-headers/demo.html b/guides/ui-atoms/state-aware-sticky-headers/demo.html similarity index 58% rename from guides/ui-atoms/context-sensitive-sticky-headers/demo.html rename to guides/ui-atoms/state-aware-sticky-headers/demo.html index d5a4acb8b..2341c9220 100644 --- a/guides/ui-atoms/context-sensitive-sticky-headers/demo.html +++ b/guides/ui-atoms/state-aware-sticky-headers/demo.html @@ -3,7 +3,7 @@ - Context-Sensitive Sticky Headers + State-Aware Sticky Headers + + + + +
+ +
+
Content Block 1
+
Content Block 2
+
Content Block 3
+
Content Block 4
+
Content Block 5
+
+ + + + diff --git a/guides/ui-atoms/state-aware-sticky-headers/tasks/task.md b/guides/ui-atoms/state-aware-sticky-headers/tasks/task.md new file mode 100644 index 000000000..4f52d2c3e --- /dev/null +++ b/guides/ui-atoms/state-aware-sticky-headers/tasks/task.md @@ -0,0 +1,5 @@ +--- +base_app: daily-grind +--- +- Add new section headers inside the main content area of the page (e.g., within the cards or sections). These headers should stick to the top when scrolling. Use the class `sticky-container` for the container and `sticky-header` for the header. To avoid collisions with the existing site navigation, use a named container. When the headers are stuck at the top, change their background color to blue, add a shadow, and reduce their padding so they take up less room. Ensure there is enough scrollable content *above* the first sticky header so that it is not stuck on initial page load. The implementation should assume the document/viewport is the scroll root. +- Add sticky headers to the main sections of the page that stick to the top of the viewport as I scroll down. I want them to look compact and distinct when they are stuck, maybe a blue background with a shadow. Please use modern CSS container queries instead of Javascript so it's performant. Ensure there is enough scrollable content *above* the first sticky header so that it is not stuck on initial page load.