Keep your coding agent up to date with the latest web best practices
Release v0.0.179
github-actions[bot]684ab9d7c6b7
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 627ca8a..7a364e3 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -8,7 +8,7 @@"name": "modern-web-guidance","source": "./","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.178"+ "version": "0.0.179"}]}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 9c03e59..47c632a 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.178",+ "version": "0.0.179","author": {"name": "Google Chrome"}diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.jsonindex ece71c9..59b2a2e 100644--- a/.cursor-plugin/plugin.json+++ b/.cursor-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Modern Web Guidance is an agent skill and CLI tool designed to help AI coding agents build web applications using modern, secure, and high-performance APIs rather than outdated workarounds. Supported by the Google Chrome team, it injects expert-curated web platform best practices directly into an agent's context window to prevent the generation of bloated, legacy code.",- "version": "0.0.178",+ "version": "0.0.179","author": {"name": "Google Chrome"}diff --git a/.github/plugin/plugin.json b/.github/plugin/plugin.jsonnew file mode 100644index 0000000..59b2a2e--- /dev/null+++ b/.github/plugin/plugin.json@@ -0,0 +1,8 @@+{+ "name": "modern-web-guidance",+ "description": "Modern Web Guidance is an agent skill and CLI tool designed to help AI coding agents build web applications using modern, secure, and high-performance APIs rather than outdated workarounds. Supported by the Google Chrome team, it injects expert-curated web platform best practices directly into an agent's context window to prevent the generation of bloated, legacy code.",+ "version": "0.0.179",+ "author": {+ "name": "Google Chrome"+ }+}diff --git a/README.md b/README.mdindex 309bd2e..2632a92 100644--- a/README.md+++ b/README.md@@ -79,8 +79,9 @@ We cover the past several years of the web platform's new features, all the way</tr></table>-_View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/navigation-drawer.md).+_View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/overlays/navigation-drawer.md).+<!-- INJECT_SKILL_COVERAGE_START -->#### The full list<details>@@ -139,7 +140,7 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro</details><details>-<summary><strong>128 real-world developer use cases</strong></summary>+<summary><strong>130 real-world developer use cases</strong></summary><h3>accessibility</h3>@@ -154,7 +155,22 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro<h3>css</h3>-- **[highlight-text-ranges](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/highlight-text-ranges.md)**: Highlight arbitrary text ranges on a page such as search results, spelling errors, or collaborative editing cursors.+- **[animate-to-intrinsic-sizes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/animate-to-intrinsic-sizes.md)**: Smoothly animate interactive components (like accordions, menus, and expanding cards) to and from their natural dimensions.+- **[calculate-with-intrinsic-sizes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/calculate-with-intrinsic-sizes.md)**: Calculate the size of an element based on its intrinsic size, while ensuring it fits within given design constraints.+- **[child-state-based-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/child-state-based-styling.md)**: Build a component that changes its styling based on the state of one of its child elements. For example, a component that renders in light or dark mode based on whether a theme toggle is checked (or not).+- **[content-based-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/content-based-styling.md)**: Build a component that changes its layout based on whether it contains specific child elements (or not). For example, if the component contains an image, use a multi-column layout, otherwise default to a single-column layout.+- **[design-token-reactivity](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/design-token-reactivity.md)**: Define higher-order design tokens, like density modes (compact, comfortable, spacious) or themes and have descendant components react to changes directly and in component-appropriate ways.+- **[dynamic-sibling-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/dynamic-sibling-styling.md)**: Create dynamic visual spectrums or layout arrangements that automatically adapt to the number of elements in a group.+- **[fluid-scaling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/fluid-scaling.md)**: Scale items like font size, spacing, and media sizes smoothly based on the parent container's size rather than using fixed breakpoints+- **[individual-transform-properties](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/individual-transform-properties.md)**: Animate or override individual CSS transform properties (e.g. translate, rotate, scale) independently of other transform properties on a single element.+- **[overflow-clipping-control](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/overflow-clipping-control.md)**: Adjust the visible clipping boundary of an element to align with the content edge, padding edge, or border edge—or a specified offset from any of these—offering finer-grained control over how content is clipped.+- **[reduce-style-repetition](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/reduce-style-repetition.md)**: Reduce excessive style repetition by encapsulating complex or dynamic styling logic into reusable functions (such as a function that computes a gradient based on a set of input parameters).+- **[size-aware-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/size-aware-styling.md)**: Build a component whose styles can be conditionally dependent on its own width or height, rather than the width or height of the viewport. For example a card component that can change its layouts depending on how large it is, or a call-to-action button that can conditionally display helper text based on its width.+- **[style-parent-with-has](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css/style-parent-with-has.md)**: Style parent elements of a form field (e.g. labels or fieldsets) when the field is invalid.++<h3>css-layout</h3>++- **[usage-aware-component-variations](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/css-layout/usage-aware-component-variations.md)**: Build components that adapt visual logic based on semantic context using CSS container style queries.<h3>forms</h3>@@ -173,13 +189,16 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro- **[select-menu-interaction](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/forms/select-menu-interaction.md)**: Validate that a non-default option has been chosen in a select menu only after the user has interacted with the control.- **[validate-input-after-interaction](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/forms/validate-input-after-interaction.md)**: Show form field validation feedback (e.g. password complexity or email format requirements) only after the user has finished their initial interaction, avoiding premature errors on page load or while the user is typing.-<h3>passkeys</h3>+<h3>js</h3>-- **[passkey-authentication](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/passkeys/passkey-authentication.md)**: Authenticate a returning user with a passkey for primary sign-in.-- **[passkey-conditional-create](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/passkeys/passkey-conditional-create.md)**: Silently register a passkey for an existing user after a successful password login.-- **[passkey-management](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/passkeys/passkey-management.md)**: Let users view and manage the passkeys registered to their account.-- **[passkey-reauthentication](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/passkeys/passkey-reauthentication.md)**: Verify a signed-in user's identity using their existing passkeys before a sensitive action.-- **[passkey-registration](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/passkeys/passkey-registration.md)**: Register a passkey for an existing user account.+- **[calculate-event-differentials](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/calculate-event-differentials.md)**: Calculate the duration and time remaining between dates and times.+- **[capture-location-agnostic-data](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/capture-location-agnostic-data.md)**: Record chronological data that should not change based on a user's location, such as birthdates, recurring alarms, or national holidays.+- **[coordinate-global-events](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/coordinate-global-events.md)**: Schedule future meetings or events by explicitly binding them to a geographical IANA time zone so that event times remain accurate regardless of Daylight Saving Time (DST) transitions, "skipped" or "repeated" hours during clock changes.+- **[format-human-readable-durations](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/format-human-readable-durations.md)**: Present elapsed time or durations to users in a readable, localized format, with the flexibility to display either detailed unit breakdowns (e.g., "1 hour and 30 minutes") or total unit counts (e.g., "90 minutes") depending on context.+- **[manage-recurring-intervals](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/manage-recurring-intervals.md)**: Calculate recurring intervals for subscription billings or payroll cycles, automatically adjusting for edge cases such as month-end transitions (e.g., adding one month to January 31st) to ensure accurate period calculations.+- **[model-partial-time-concepts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/model-partial-time-concepts.md)**: Model date and time concepts that inherently lack a standard component (such as a specific year, day, or date) without using arbitrary placeholder values that introduce calculation errors.+- **[stabilize-reactive-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/stabilize-reactive-state.md)**: Manage task deadlines or schedules in data-driven views without unexpected side effects from shared mutable state.+- **[support-global-calendar-systems](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/js/support-global-calendar-systems.md)**: Display and calculate dates in non-Gregorian calendar systems (e.g., Islamic, Hebrew, or Chinese) accurately for international users.<h3>performance</h3>@@ -189,10 +208,12 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro- **[conditional-async-dependencies](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/conditional-async-dependencies.md)**: Conditionally load or initialize async dependencies (such as importing polyfills for missing web features) without requiring complex orchestration across all of a page's script dependencies.- **[defer-rendering-heavy-content](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/defer-rendering-heavy-content.md)**: Reduce rendering times in content-heavy web pages (e.g. pages with long feeds, lots of articles, or complex dashboards), by deferring rendering for any content that is not immediately visible to the user.- **[defer-work-until-scroll-ends](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/defer-work-until-scroll-ends.md)**: Defer expensive operations like DOM updates, data fetching, analytics tracking, or layout recalculation until after scrolling completes to maintain smooth scroll performance.+- **[deliver-optimized-decorative-images](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/deliver-optimized-decorative-images.md)**: Deliver optimized decorative images (such as backgrounds, UI icons, or complex masks) by simultaneously providing next-generation image formats (like AVIF or WebP) alongside multiple pixel densities (like 1x and 2x) so the browser can dynamically negotiate the best combination of file size and visual quality for the user's device capabilities.- **[deprioritize-background-fetches](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/deprioritize-background-fetches.md)**: Deprioritize background data fetches made with the Fetch API to prevent network contention with user-initiated requests.- **[detect-initial-visibility-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/detect-initial-visibility-state.md)**: Reliably determine whether a page was initially loaded in the background, even in cases where the script is loaded asynchronously after the user foregrounded the page.- **[efficient-background-processing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/efficient-background-processing.md)**: Conserve system resources and battery life by pausing background JavaScript execution (such as `<canvas>` animations, WebGL rendering, or high-frequency WebSocket data polling) when the component is off-screen and then resume them just-in-time when they scroll back into view.- **[faster-spa-view-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/faster-spa-view-transitions.md)**: Enable faster transitions back to previously visited views in a Single-Page Application (SPA) by preserving their structural DOM state instead of destroying and rebuilding them on every navigation.+- **[flicker-free-client-side-ab-testing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/flicker-free-client-side-ab-testing.md)**: Deliver and render A/B tests, multi-variate tests, or other experiments using client-side JavaScript to alter or inject HTML, CSS, and JavaScript without the original content showing first before flickering or flashing to show the experiment content.- **[full-session-analytics](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/full-session-analytics.md)**: Reliably track analytics, errors, and telemetry data across the user's entire page visit, and defer sending of the data until the user leaves the page.- **[identify-heavy-scripts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/identify-heavy-scripts.md)**: Identify the scripts most responsible for long animation frames- **[identify-inp-causes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/identify-inp-causes.md)**: Identify slow running JavaScript that is impacting INP metric@@ -209,93 +230,91 @@ _View an example:_ [the `navigation-drawer` guide](https://github.com/GoogleChro- **[privacy](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/privacy/privacy.md)**: Action-oriented guidelines for web developers to implement privacy by design, data minimization, third-party audits, and secure data handling. Use this skill when designing applications, integrating third-party services, handling user data, or configuring security headers.-<h3>user-experience</h3>--- **[adapt-scrollbar-to-contrast-preferences](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/adapt-scrollbar-to-contrast-preferences.md)**: Enhance scrollbar visibility for users who prefer high-contrast interfaces-- **[anchor-positioning-tab-underline](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/anchor-positioning-tab-underline.md)**: Transition an element seamlessly between two target element positions. For example, moving a selected tab underline between the previously selected tab and the currently selected tab.-- **[animate-element-entry-exit](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/animate-element-entry-exit.md)**: Smoothly hide/show elements as they are added/removed from the DOM or as their display values are toggled.-- **[animate-to-from-top-layer](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/animate-to-from-top-layer.md)**: Animate elements such as dialogs, popovers, and tooltips as they're entering/exiting the top layer.-- **[animate-to-intrinsic-sizes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/animate-to-intrinsic-sizes.md)**: Smoothly animate interactive components (like accordions, menus, and expanding cards) to and from their natural dimensions.-- **[apply-webgl-shaders](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/apply-webgl-shaders.md)**: Apply custom visual effects with WebGL shaders to HTML content.-- **[calculate-event-differentials](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/calculate-event-differentials.md)**: Calculate the duration and time remaining between dates and times.-- **[calculate-with-intrinsic-sizes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/calculate-with-intrinsic-sizes.md)**: Calculate the size of an element based on its intrinsic size, while ensuring it fits within given design constraints.-- **[capture-location-agnostic-data](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/capture-location-agnostic-data.md)**: Record chronological data that should not change based on a user's location, such as birthdates, recurring alarms, or national holidays.-- **[carousel-slide-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/carousel-slide-effects.md)**: Create a carousel of slides with images or other visual elements, where each slide animates as they enter/center/exit their scroller. For example, the slides may fade-in/fade-out, rotate, get bigger or smaller, etc.-- **[carousel-snap-highlights](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/carousel-snap-highlights.md)**: Visually highlight the currently snapped non-interactive item in scroll-snapping carousels, galleries, or full-page swipe experiences. For example, expanding a card when snapped, or revealing hidden content.-- **[child-state-based-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/child-state-based-styling.md)**: Build a component that changes its styling based on the state of one of its child elements. For example, a component that renders in light or dark mode based on whether a theme toggle is checked (or not).-- **[complex-shapes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/complex-shapes.md)**: Clip elements and their content to any free-form shape, like a symbol, brush stroke, or organic texture for more expressive designs.-- **[component-specific-light-dark-theme](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/component-specific-light-dark-theme.md)**: Force certain elements to be in light mode or dark mode (e.g. code blocks, media players, etc) independently of the page's color-scheme.-- **[consistent-cross-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/consistent-cross-document-transitions.md)**: Ensure critical page state is loaded and stable before initiating a cross-document view transition. This means critical CSS styles are loaded and applied, critical JavaScript is loaded and run, and the HTML visible for the user's initial view of the page has been parsed before the transition runs.-- **[content-based-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/content-based-styling.md)**: Build a component that changes its layout based on whether it contains specific child elements (or not). For example, if the component contains an image, use a multi-column layout, otherwise default to a single-column layout.-- **[coordinate-global-events](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/coordinate-global-events.md)**: Schedule future meetings or events by explicitly binding them to a geographical IANA time zone so that event times remain accurate regardless of Daylight Saving Time (DST) transitions, "skipped" or "repeated" hours during clock changes.-- **[cross-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/cross-document-transitions.md)**: Create smooth, seamless transitions between full page navigations, such as cross-fades, custom reveal effects, or morphing of content from one page to the next.-- **[custom-button-actions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/custom-button-actions.md)**: Declaratively connect a button to any element to trigger custom, application-specific actions using declarative button commands, invoker commands, button commands, custom commands, or declarative toggle actions.-- **[customize-scrollbar-color-and-thickness](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/customize-scrollbar-color-and-thickness.md)**: Customize the color or thickness of a scrollbar-- **[dark-mode](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/dark-mode.md)**: Implement dark mode support in a way that respects the user's light/dark theme preference and adapts browser UI (e.g. scrollbars, form controls, etc)-- **[declarative-dialog-popover-control](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/declarative-dialog-popover-control.md)**: Toggle the visibility of a dialog or popover from a button without writing JavaScript.-- **[deliver-optimized-decorative-images](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/deliver-optimized-decorative-images.md)**: Deliver optimized decorative images (such as backgrounds, UI icons, or complex masks) by simultaneously providing next-generation image formats (like AVIF or WebP) alongside multiple pixel densities (like 1x and 2x) so the browser can dynamically negotiate the best combination of file size and visual quality for the user's device capabilities.-- **[design-token-reactivity](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/design-token-reactivity.md)**: Define higher-order design tokens, like density modes (compact, comfortable, spacious) or themes and have descendant components react to changes directly and in component-appropriate ways.-- **[directional-navigation-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/directional-navigation-transitions.md)**: Animate visual state changes to reflect the direction of a user's navigational flow, such as sliding new content in from the right when advancing forward or from the left when returning to a previous screen.-- **[dynamic-sibling-animations](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/dynamic-sibling-animations.md)**: Stagger animation or transition timing across sibling elements so each one starts after a computed delay based on its position in the sibling list.-- **[dynamic-sibling-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/dynamic-sibling-styling.md)**: Create dynamic visual spectrums or layout arrangements that automatically adapt to the number of elements in a group.-- **[export-html-media-from-canvas](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/export-html-media-from-canvas.md)**: Capture and export dynamic HTML content as images or video frames from within canvas.-- **[expose-canvas-content-to-browser-features](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/expose-canvas-content-to-browser-features.md)**: Expose content rendered in a canvas to browser features like assistive technologies, translation, or reading mode.-- **[flicker-free-client-side-ab-testing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/flicker-free-client-side-ab-testing.md)**: Deliver and render A/B tests, multi-variate tests, or other experiments using client-side JavaScript to alter or inject HTML, CSS, and JavaScript without the original content showing first before flickering or flashing to show the experiment content.-- **[fluid-scaling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/fluid-scaling.md)**: Scale items like font size, spacing, and media sizes smoothly based on the parent container's size rather than using fixed breakpoints-- **[format-human-readable-durations](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/format-human-readable-durations.md)**: Present elapsed time or durations to users in a readable, localized format, with the flexibility to display either detailed unit breakdowns (e.g., "1 hour and 30 minutes") or total unit counts (e.g., "90 minutes") depending on context.-- **[group-element-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/group-element-transitions.md)**: Transition a group of similar elements simultaneously using the same transition logic, such as removing a product from a shopping cart and having all the other products animate into their new positions.-- **[improve-text-layout-and-legibility](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/improve-text-layout-and-legibility.md)**: Improve the layout and legibility of short standalone text content, such as headings no longer than a few lines, by enabling the browser to apply evenly balanced line breaks when wrapping text.-- **[individual-transform-properties](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/individual-transform-properties.md)**: Animate or override individual CSS transform properties (e.g. translate, rotate, scale) independently of other transform properties on a single element.-- **[interactive-content-in-3d-scenes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/interactive-content-in-3d-scenes.md)**: Integrate interactive HTML elements into a 3D scene.-- **[interactive-content-reveal](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/interactive-content-reveal.md)**: Create interactive reveal effects, such as a spotlight that follows the user's pointer to uncover details within an image or UI section.-- **[interest-triggered-action-previews](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/interest-triggered-action-previews.md)**: Show a live preview of a button's effect when a user signals interest (e.g. hovering, focusing, or long-pressing) but before they commit to clicking.-- **[interest-triggered-tooltips](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/interest-triggered-tooltips.md)**: Show a tooltip or supplemental information when a user hovers over, focuses on, or long-presses an interactive element, without requiring a click.-- **[light-dismiss-a-dialog](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/light-dismiss-a-dialog.md)**: Create a modal dialog that can be closed via light dismiss (i.e. clicking or tapping outside of the dialog)-- **[manage-recurring-intervals](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/manage-recurring-intervals.md)**: Calculate recurring intervals for subscription billings or payroll cycles, automatically adjusting for edge cases such as month-end transitions (e.g., adding one month to January 31st) to ensure accurate period calculations.-- **[model-partial-time-concepts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/model-partial-time-concepts.md)**: Model date and time concepts that inherently lack a standard component (such as a specific year, day, or date) without using arbitrary placeholder values that introduce calculation errors.-- **[move-dom-element-without-losing-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/move-dom-element-without-losing-state.md)**: Move or reparent a DOM element without losing important element state, such as interactivity states (:focus/:active), `<iframe>` loading state, animation/transition state, etc-- **[navigation-drawer](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/navigation-drawer.md)**: Create a navigation drawer component that, when triggered from a menu button, slides in from the side overlayed on top of existing page content, and slides out when dismissed (by swiping away, tapping outside, or pressing escape).-- **[overflow-clipping-control](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/overflow-clipping-control.md)**: Adjust the visible clipping boundary of an element to align with the content edge, padding edge, or border edge—or a specified offset from any of these—offering finer-grained control over how content is clipped.-- **[parallax-scroll-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/parallax-scroll-effects.md)**: Create scroll-based effects (such as parallax) where foreground and background layers move at different rates, creating a sense of depth as the user scrolls.-- **[persistent-app-tours](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/persistent-app-tours.md)**: Create persistent onboarding walkthroughs using tethered native overlays that stay open during user interaction.-- **[persistent-toast-notifications](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/persistent-toast-notifications.md)**: Create non-intrusive toast and overlay notifications for persistent, stackable messaging and state communication.-- **[persistent-top-layer-ui](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/persistent-top-layer-ui.md)**: Keep a modal dialog, fullscreen element, or native popover visibly open and functionally active when its underlying DOM node is moved or reparented in the DOM.-- **[physics-based-easing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/physics-based-easing.md)**: Create custom, physics-based animation and transition effects, like bounce and spring, that feel more natural and engaging than traditional easing curves.-- **[platform-controls-dismiss-dialog](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/platform-controls-dismiss-dialog.md)**: Create a modal dialog that can be closed via standard platform-specific user actions, such as pressing the `Esc` key on desktop platforms, or a "back" or "dismiss" gesture on mobile platforms-- **[position-aware-tooltips](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/position-aware-tooltips.md)**: Build tooltips and popovers with directional arrows (or other visual styling) that automatically point the correct way when the element flips to a fallback position.-- **[precise-text-alignment](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/precise-text-alignment.md)**: Achieve precise vertical alignment with text of any font. For example, exactly equal visual padding above and below text, or aligning text perfectly flush with adjacent icons or images.-- **[prevent-text-wrapping](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/prevent-text-wrapping.md)**: Ensure the browser does not insert line breaks into text and will allow text to overflow its container.-- **[pull-to-reveal](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/pull-to-reveal.md)**: Build a pull-to-reveal feature that would enable the user to pull down on the screen to reveal more content, like a search bar.-- **[reduce-style-repetition](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/reduce-style-repetition.md)**: Reduce excessive style repetition by encapsulating complex or dynamic styling logic into reusable functions (such as a function that computes a gradient based on a set of input parameters).-- **[resilient-context-menus-and-nested-dropdowns](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md)**: Build accessible, responsive menus, tooltips, dropdowns, or contextual overlays that must be tethered to specific UI elements, guaranteeing that the overlay automatically repositions itself (e.g., flipping axes) when it encounters viewport edges, ensuring it never gets cut off.-- **[same-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/same-document-transitions.md)**: Visually connect persisting elements across different page states or navigations in a Single Page Application (SPA) (e.g. expanding a product thumbnail into a full-bleed hero image) by smoothly morphing their size, position, or other styling properties.-- **[scroll-entry-exit-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scroll-entry-exit-effects.md)**: Create fade-in, scale-up, or other complex reveal-type effects on elements as they enter and exit the scrollport (or viewport) while the user is scrolling.-- **[scroll-position-aware-elements](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scroll-position-aware-elements.md)**: Build floating buttons or widgets (back-to-top, scroll-to-bottom, chat launchers, etc.) that appear and disappear based on whether the user has scrolled at all.-- **[scroll-progress-indicator](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/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.-- **[scroll-snap-realtime-feedback](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scroll-snap-realtime-feedback.md)**: Provide real-time visual feedback in linked UI elements while a user scrolls through snap-aligned content, before the scroll gesture completes.-- **[scroll-snap-state-sync](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scroll-snap-state-sync.md)**: Synchronize navigation indicators, linked content panels, and analytics tracking with the actively snapped item in a scrollable container.-- **[scroll-target-on-load](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scroll-target-on-load.md)**: Build a scrollable list of elements (e.g. a carousel of images or a chat conversation thread) that can be displayed with a particular element scrolled into view on the initial render.-- **[scrollability-affordance-hints](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/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.-- **[scrollytelling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/scrollytelling.md)**: Animate visual properties on a target element — such as fading a backdrop, shifting a background color, or to create scrollytelling experiences — driven entirely by the scrollport position of a completely different element.-- **[search-hidden-content](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/search-hidden-content.md)**: Hide content from view using patterns such as accordions, tabs, and "Read more" sections, while ensuring the hidden text reveals itself during native "Find in page" searches, allows search engine indexing, supports URL fragment deep links, and maintains ARIA accessibility.-- **[shaped-cutouts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/shaped-cutouts.md)**: Combine multiple shapes to create complex cutouts or 'knockout' effects in elements, such as adding a notch to an element.-- **[shrinking-header-on-scroll](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/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.-- **[size-aware-styling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/size-aware-styling.md)**: Build a component whose styles can be conditionally dependent on its own width or height, rather than the width or height of the viewport. For example a card component that can change its layouts depending on how large it is, or a call-to-action button that can conditionally display helper text based on its width.-- **[soft-edge-content-fade](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/soft-edge-content-fade.md)**: Apply a transparency gradient to content edges to indicate further scrollable areas or to obscure payment-walled text.-- **[stabilize-reactive-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/stabilize-reactive-state.md)**: Manage task deadlines or schedules in data-driven views without unexpected side effects from shared mutable state.-- **[stack-drill-down](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/stack-drill-down.md)**: Build full-screen hierarchical navigation that lets users drill down into nested views and swipe or navigate back to return, with browser history kept in sync.-- **[style-parent-with-has](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/style-parent-with-has.md)**: Style parent elements of a form field (e.g. labels or fieldsets) when the field is invalid.-- **[support-global-calendar-systems](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/support-global-calendar-systems.md)**: Display and calculate dates in non-Gregorian calendar systems (e.g., Islamic, Hebrew, or Chinese) accurately for international users.-- **[swipe-to-remove](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/swipe-to-remove.md)**: Let users act on items in a list (remove, archive, mark as read, etc.) with a horizontal swipe gesture, so they can process entries quickly without tapping a separate control.-- **[visually-stable-font-fallbacks](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/visually-stable-font-fallbacks.md)**: Define font styles such that text remains readable and visually consistent in the event that there's a swap between the perferred font and one of the fallbacks (or vise versa).-- **[visually-stable-mixed-fonts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/visually-stable-mixed-fonts.md)**: Define font styles such that text remains readable and visually consistent in situations where multiple fonts are used to render a single block of text.-- **[visually-texture-content](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/visually-texture-content.md)**: Apply realistic weathering and texture patterns to elements to give them an organic, aged, or physical material appearance.+<h3>security</h3>++- **[passkey-authentication](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkey-authentication.md)**: Authenticate a returning user with a passkey for primary sign-in.+- **[passkey-conditional-create](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkey-conditional-create.md)**: Silently register a passkey for an existing user after a successful password login.+- **[passkey-management](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkey-management.md)**: Let users view and manage the passkeys registered to their account.+- **[passkey-reauthentication](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkey-reauthentication.md)**: Verify a signed-in user's identity using their existing passkeys before a sensitive action.+- **[passkey-registration](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkey-registration.md)**: Register a passkey for an existing user account.+- **[passkeys](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/security/passkeys.md)**: Comprehensive orientation and cross-cutting principles for implementing WebAuthn and Passkeys in web applications. Use this guide when handling passkey registration, authentication, management, or reauthentication.++<h3>ui-atoms</h3>++- **[carousel-slide-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/carousel-slide-effects.md)**: Create a carousel of slides with images or other visual elements, where each slide animates as they enter/center/exit their scroller. For example, the slides may fade-in/fade-out, rotate, get bigger or smaller, etc.+- **[component-specific-light-dark-theme](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/component-specific-light-dark-theme.md)**: Force certain elements to be in light mode or dark mode (e.g. code blocks, media players, etc) independently of the page's color-scheme.+- **[position-aware-tooltips](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/position-aware-tooltips.md)**: Build tooltips and popovers with directional arrows (or other visual styling) that automatically point the correct way when the element flips to a fallback position.+- **[pull-to-reveal](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/pull-to-reveal.md)**: Build a pull-to-reveal feature that would enable the user to pull down on the screen to reveal more content, like a search bar.+- **[resilient-context-menus-and-nested-dropdowns](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/resilient-context-menus-and-nested-dropdowns.md)**: Build accessible, responsive menus, tooltips, dropdowns, or contextual overlays that must be tethered to specific UI elements, guaranteeing that the overlay automatically repositions itself (e.g., flipping axes) when it encounters viewport edges, ensuring it never gets cut off.+- **[scroll-position-aware-elements](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-atoms/scroll-position-aware-elements.md)**: Build floating buttons or widgets (back-to-top, scroll-to-bottom, chat launchers, etc.) that appear and disappear based on whether the user has scrolled at all.+- **[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.++<h3>ui-behaviors</h3>++- **[anchor-positioning-tab-underline](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/anchor-positioning-tab-underline.md)**: Transition an element seamlessly between two target element positions. For example, moving a selected tab underline between the previously selected tab and the currently selected tab.+- **[animate-element-entry-exit](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/animate-element-entry-exit.md)**: Smoothly hide/show elements as they are added/removed from the DOM or as their display values are toggled.+- **[animate-to-from-top-layer](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/animate-to-from-top-layer.md)**: Animate elements such as dialogs, popovers, and tooltips as they're entering/exiting the top layer.+- **[carousel-snap-highlights](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/carousel-snap-highlights.md)**: Visually highlight the currently snapped non-interactive item in scroll-snapping carousels, galleries, or full-page swipe experiences. For example, expanding a card when snapped, or revealing hidden content.+- **[consistent-cross-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/consistent-cross-document-transitions.md)**: Ensure critical page state is loaded and stable before initiating a cross-document view transition. This means critical CSS styles are loaded and applied, critical JavaScript is loaded and run, and the HTML visible for the user's initial view of the page has been parsed before the transition runs.+- **[cross-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/cross-document-transitions.md)**: Create smooth, seamless transitions between full page navigations, such as cross-fades, custom reveal effects, or morphing of content from one page to the next.+- **[custom-button-actions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/custom-button-actions.md)**: Declaratively connect a button to any element to trigger custom, application-specific actions using declarative button commands, invoker commands, button commands, custom commands, or declarative toggle actions.+- **[declarative-dialog-popover-control](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/declarative-dialog-popover-control.md)**: Toggle the visibility of a dialog or popover from a button without writing JavaScript.+- **[directional-navigation-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/directional-navigation-transitions.md)**: Animate visual state changes to reflect the direction of a user's navigational flow, such as sliding new content in from the right when advancing forward or from the left when returning to a previous screen.+- **[dynamic-sibling-animations](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/dynamic-sibling-animations.md)**: Stagger animation or transition timing across sibling elements so each one starts after a computed delay based on its position in the sibling list.+- **[group-element-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/group-element-transitions.md)**: Transition a group of similar elements simultaneously using the same transition logic, such as removing a product from a shopping cart and having all the other products animate into their new positions.+- **[highlight-text-ranges](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/highlight-text-ranges.md)**: Highlight arbitrary text ranges on a page such as search results, spelling errors, or collaborative editing cursors.+- **[interactive-content-reveal](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/interactive-content-reveal.md)**: Create interactive reveal effects, such as a spotlight that follows the user's pointer to uncover details within an image or UI section.+- **[interest-triggered-action-previews](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-action-previews.md)**: Show a live preview of a button's effect when a user signals interest (e.g. hovering, focusing, or long-pressing) but before they commit to clicking.+- **[interest-triggered-tooltips](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-tooltips.md)**: Show a tooltip or supplemental information when a user hovers over, focuses on, or long-presses an interactive element, without requiring a click.+- **[light-dismiss-a-dialog](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/light-dismiss-a-dialog.md)**: Create a modal dialog that can be closed via light dismiss (i.e. clicking or tapping outside of the dialog)+- **[move-dom-element-without-losing-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/move-dom-element-without-losing-state.md)**: Move or reparent a DOM element without losing important element state, such as interactivity states (:focus/:active), `<iframe>` loading state, animation/transition state, etc+- **[parallax-scroll-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/parallax-scroll-effects.md)**: Create scroll-based effects (such as parallax) where foreground and background layers move at different rates, creating a sense of depth as the user scrolls.+- **[persistent-top-layer-ui](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/persistent-top-layer-ui.md)**: Keep a modal dialog, fullscreen element, or native popover visibly open and functionally active when its underlying DOM node is moved or reparented in the DOM.+- **[physics-based-easing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/physics-based-easing.md)**: Create custom, physics-based animation and transition effects, like bounce and spring, that feel more natural and engaging than traditional easing curves.+- **[platform-controls-dismiss-dialog](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/platform-controls-dismiss-dialog.md)**: Create a modal dialog that can be closed via standard platform-specific user actions, such as pressing the `Esc` key on desktop platforms, or a "back" or "dismiss" gesture on mobile platforms+- **[same-document-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/same-document-transitions.md)**: Visually connect persisting elements across different page states or navigations in a Single Page Application (SPA) (e.g. expanding a product thumbnail into a full-bleed hero image) by smoothly morphing their size, position, or other styling properties.+- **[scroll-entry-exit-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/scroll-entry-exit-effects.md)**: Create fade-in, scale-up, or other complex reveal-type effects on elements as they enter and exit the scrollport (or viewport) while the user is scrolling.+- **[scroll-snap-realtime-feedback](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-realtime-feedback.md)**: Provide real-time visual feedback in linked UI elements while a user scrolls through snap-aligned content, before the scroll gesture completes.+- **[scroll-snap-state-sync](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-state-sync.md)**: Synchronize navigation indicators, linked content panels, and analytics tracking with the actively snapped item in a scrollable container.+- **[scroll-target-on-load](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/scroll-target-on-load.md)**: Build a scrollable list of elements (e.g. a carousel of images or a chat conversation thread) that can be displayed with a particular element scrolled into view on the initial render.+- **[scrollytelling](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/scrollytelling.md)**: Animate visual properties on a target element — such as fading a backdrop, shifting a background color, or to create scrollytelling experiences — driven entirely by the scrollport position of a completely different element.+- **[search-hidden-content](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/search-hidden-content.md)**: Hide content from view using patterns such as accordions, tabs, and "Read more" sections, while ensuring the hidden text reveals itself during native "Find in page" searches, allows search engine indexing, supports URL fragment deep links, and maintains ARIA accessibility.+- **[swipe-to-remove](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-behaviors/swipe-to-remove.md)**: Let users act on items in a list (remove, archive, mark as read, etc.) with a horizontal swipe gesture, so they can process entries quickly without tapping a separate control.++<h3>ui-components</h3>++- **[navigation-drawer](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-components/navigation-drawer.md)**: Create a navigation drawer component that, when triggered from a menu button, slides in from the side overlayed on top of existing page content, and slides out when dismissed (by swiping away, tapping outside, or pressing escape).+- **[persistent-app-tours](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-components/persistent-app-tours.md)**: Create persistent onboarding walkthroughs using tethered native overlays that stay open during user interaction.+- **[persistent-toast-notifications](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-components/persistent-toast-notifications.md)**: Create non-intrusive toast and overlay notifications for persistent, stackable messaging and state communication.+- **[stack-drill-down](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/ui-components/stack-drill-down.md)**: Build full-screen hierarchical navigation that lets users drill down into nested views and swipe or navigate back to return, with browser history kept in sync.++<h3>visual-design</h3>++- **[adapt-scrollbar-to-contrast-preferences](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/adapt-scrollbar-to-contrast-preferences.md)**: Enhance scrollbar visibility for users who prefer high-contrast interfaces+- **[apply-webgl-shaders](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/apply-webgl-shaders.md)**: Apply custom visual effects with WebGL shaders to HTML content.+- **[complex-shapes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/complex-shapes.md)**: Clip elements and their content to any free-form shape, like a symbol, brush stroke, or organic texture for more expressive designs.+- **[customize-scrollbar-color-and-thickness](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/customize-scrollbar-color-and-thickness.md)**: Customize the color or thickness of a scrollbar+- **[dark-mode](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/dark-mode.md)**: Implement dark mode support in a way that respects the user's light/dark theme preference and adapts browser UI (e.g. scrollbars, form controls, etc)+- **[export-html-media-from-canvas](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/export-html-media-from-canvas.md)**: Capture and export dynamic HTML content as images or video frames from within canvas.+- **[expose-canvas-content-to-browser-features](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/expose-canvas-content-to-browser-features.md)**: Expose content rendered in a canvas to browser features like assistive technologies, translation, or reading mode.+- **[improve-text-layout-and-legibility](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/improve-text-layout-and-legibility.md)**: Improve the layout and legibility of short standalone text content, such as headings no longer than a few lines, by enabling the browser to apply evenly balanced line breaks when wrapping text.+- **[interactive-content-in-3d-scenes](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/interactive-content-in-3d-scenes.md)**: Integrate interactive HTML elements into a 3D scene.+- **[precise-text-alignment](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/precise-text-alignment.md)**: Achieve precise vertical alignment with text of any font. For example, exactly equal visual padding above and below text, or aligning text perfectly flush with adjacent icons or images.+- **[prevent-text-wrapping](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/prevent-text-wrapping.md)**: Ensure the browser does not insert line breaks into text and will allow text to overflow its container.+- **[shaped-cutouts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/shaped-cutouts.md)**: Combine multiple shapes to create complex cutouts or 'knockout' effects in elements, such as adding a notch to an element.+- **[soft-edge-content-fade](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/soft-edge-content-fade.md)**: Apply a transparency gradient to content edges to indicate further scrollable areas or to obscure payment-walled text.+- **[visually-stable-font-fallbacks](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/visually-stable-font-fallbacks.md)**: Define font styles such that text remains readable and visually consistent in the event that there's a swap between the perferred font and one of the fallbacks (or vise versa).+- **[visually-stable-mixed-fonts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/visually-stable-mixed-fonts.md)**: Define font styles such that text remains readable and visually consistent in situations where multiple fonts are used to render a single block of text.+- **[visually-texture-content](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/visual-design/visually-texture-content.md)**: Apply realistic weathering and texture patterns to elements to give them an organic, aged, or physical material appearance.<h3>webmcp</h3>- **[agentic-forms](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/webmcp/agentic-forms.md)**: Expose client-side functionality as tools to AI agents by annotating standard HTML forms with WebMCP attributes.- **[agentic-javascript-tools](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md)**: Programmatically register client-side JavaScript functions as tools for AI agents using the WebMCP Imperative API.</details>+<!-- INJECT_SKILL_COVERAGE_END -->### Safe Adoption of Modern Features@@ -360,6 +379,14 @@ agy plugin install https://github.com/GoogleChrome/modern-web-guidance```</details>+<details>+<summary><b>Grok Build CLI</b></summary>++```shell+grok plugin install https://github.com/GoogleChrome/modern-web-guidance --trust+```+</details>+## <img src="https://github.com/GoogleChrome/modern-web-guidance/raw/main/.github/img/refresh-cw.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> UpdatingIf you installed the skill using `npx modern-web-guidance@latest install`, you can update with: `npx modern-web-guidance@latest update`.@@ -391,18 +418,20 @@ We developed a robust eval harness to ensure that the content is **empirically p### Recent eval results snapshot+<!-- INJECT_EVAL_RESULTS_START -->| Date | Agent + Model | Tasks / Assertions | Unguided → Guided (Uplift) || :--- | :--- | :---: | :---: |-| May 18 | claude_code (opus-4-7) | 75 / 603 | 52% → 85% (**+33pp**) |-| May 17 | claude_code (opus-4-7) | 75 / 603 | 54% → 85% (**+31pp**) |-| May 16 | codex_cli (gpt-5.5) | 75 / 603 | 49% → 82% (**+33pp**) |-| May 16 | claude_code (opus-4-7) | 75 / 603 | 51% → 86% (**+35pp**) |-| May 15 | codex_cli (gpt-5.5) | 74 / 600 | 52% → 81% (**+29pp**) |-| May 15 | claude_code (opus-4-7) | 74 / 600 | 53% → 82% (**+29pp**) |-| May 15 | antigravity | 74 / 600 | 47% → 91% (**+44pp**) |-| May 14 | antigravity | 68 / 554 | 47% → 91% (**+44pp**) |-| Apr 30 | claude_code (opus-4-6) | 66 / 516 | 44% → 81% (**+37pp**) |-| Apr 28 | claude_code (opus-4-6) | 66 / 524 | 41% → 77% (**+36pp**) |+| Jul 6 | codex_cli (gpt-5.5) | 129 / 1071 | 57% → 84% (**+27pp**) |+| Jul 6 | claude_code (sonnet-5) | 129 / 1071 | 52% → 87% (**+35pp**) |+| Jul 6 | antigravity | 129 / 1071 | 54% → 87% (**+33pp**) |+| Jul 3 | codex_cli (gpt-5.5) | 129 / 1071 | 52% → 78% (**+26pp**) |+| Jul 3 | claude_code (sonnet-5) | 129 / 1071 | 48% → 82% (**+34pp**) |+| Jul 1 | claude_code (sonnet-5) | 129 / 1071 | 49% → 84% (**+35pp**) |+| Jul 1 | antigravity | 129 / 1071 | 53% → 83% (**+30pp**) |+| Jun 29 | codex_cli (gpt-5.5) | 129 / 1071 | 51% → 78% (**+27pp**) |+| Jun 29 | claude_code (opus-4-8) | 129 / 1071 | 53% → 88% (**+35pp**) |+| Jun 29 | antigravity | 129 / 1071 | 50% → 78% (**+28pp**) |+<!-- INJECT_EVAL_RESULTS_END -->## <img src="https://github.com/GoogleChrome/modern-web-guidance/raw/main/.github/img/boxes.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Available Skill Packsdiff --git a/gemini-extension.json b/gemini-extension.jsonindex 9c03e59..47c632a 100644--- a/gemini-extension.json+++ b/gemini-extension.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.178",+ "version": "0.0.179","author": {"name": "Google Chrome"}diff --git a/package.json b/package.jsonindex 901cb08..6888c36 100644--- a/package.json+++ b/package.json@@ -3,7 +3,7 @@"displayName": "Modern Web Guidance","description": "Keep your agent up to date on the latest web best practices.","license": "Apache-2.0",- "version": "0.0.178",+ "version": "0.0.179","publisher": "GoogleChrome","repository": {"url": "https://github.com/GoogleChrome/modern-web-guidance-src"diff --git a/skills/modern-web-guidance/guides/accessibility/accessibility.md b/skills/modern-web-guidance/guides/accessibility/accessibility.mdindex 84292aa..ed2e168 100644--- a/skills/modern-web-guidance/guides/accessibility/accessibility.md+++ b/skills/modern-web-guidance/guides/accessibility/accessibility.md@@ -12,7 +12,7 @@ Keep these principles in mind throughout:### Actionable Guidelines#### DOs-- **Place all content within landmarks**: Wrap the page in `<header>`, `<nav>`, `<main>`, `<aside>`, and `<footer>` so assistive-tech users can jump between regions.+- **Place all content within landmarks**: Wrap each relevant part of the page in `<header>`, `<nav>`, `<main>`, `<aside>`, and `<footer>` elements so assistive-tech users can jump between regions.- **Structure main content with headings**: Use `<h1>`–`<h6>` sequentially (no jumping `<h1>` → `<h4>`) so screen-reader users get a navigable outline.- **Use lists for repeated, contiguous content**: `<ul>`/`<ol>` give assistive tech a count up front and let users skip the entire group.- **Provide skip links** prior to repeated content like site headers with navigation or long/infinite lists, so that keyboard users can easily bypass them. Make sure the target is focusable (e.g. `<main id="content" tabindex="-1">`).diff --git a/skills/modern-web-guidance/guides/built-in-ai/prompt-api.md b/skills/modern-web-guidance/guides/built-in-ai/prompt-api.mdnew file mode 100644index 0000000..bd1e914--- /dev/null+++ b/skills/modern-web-guidance/guides/built-in-ai/prompt-api.md@@ -0,0 +1,189 @@+The Prompt API allows developers to run natural language processing tasks directly in the browser using **Gemini Nano**. This built-in AI approach ensures user privacy, reduces server costs, and enables offline functionality.++## 1. Getting Started and Hardware Requirements++The Prompt API is currently available in Chrome as of version 148 (Desktop) for Windows, macOS, Linux, and Chromebook Plus.++### Hardware Prerequisites++- **Storage**: 22 GB free space (for the initial profile and model).+- **Memory/CPU**: 16 GB RAM and 4+ CPU cores.+- **GPU**: 4 GB VRAM or more (Required for audio input).+- **Network**: Required only for the initial model download.++### Initializing the API++Check model availability before triggering a download:++```javascript+const availability = await LanguageModel.availability();++// Do not call create() when unavailable — the model cannot run on this device.+if (availability !== 'unavailable') {+ const session = await LanguageModel.create({+ monitor(m) {+ // Inform the user while the model downloads so the UI doesn't appear frozen.+ m.addEventListener('downloadprogress', (e) => {+ console.log(`Downloaded ${e.loaded * 100}%`);+ });+ },+ });+}+```++## 2. Core Prompting Capabilities++Session examples in this section omit `session.destroy()` for brevity. Always call `session.destroy()` when a session is no longer needed to free device memory (see Section 5).++### Basic and Streamed Output++For short responses, use `prompt()`. For longer content, use `promptStreaming()` to provide a more responsive UI.++**MANDATORY**: Never assign model output to `innerHTML`. Model output is untrusted and can contain injected markup. Always use `textContent` or a sanitizer.++```javascript+const session = await LanguageModel.create();++// prompt() accumulates the full response before resolving — use for short, one-shot output.+const result = await session.prompt('Write a haiku about coding.');+// textContent, not innerHTML — model output is untrusted and must not be parsed as markup.+outputEl.textContent = result;++// promptStreaming() yields independent chunks that must be concatenated;+// use for longer content so each chunk can be rendered progressively.+const stream = session.promptStreaming('Write a long story about a robot.');+let completeResult = '';+for await (const chunk of stream) {+ completeResult += chunk;+ outputEl.append(chunk);+}+console.log('Full story:', completeResult);+```++### Multimodal Input++The Prompt API supports text, audio, and visual inputs (images, canvas, video frames).++```javascript+const session = await LanguageModel.create({+ // Declaring expected input types lets the browser optimize model loading.+ expectedInputs: [{ type: 'text' }, { type: 'image' }],+ expectedOutputs: [{ type: 'text' }],+});++const response = await session.prompt([+ {+ role: 'user',+ content: [+ { type: 'text', value: 'What is in this image?' },+ { type: 'image', value: document.querySelector('canvas') },+ ],+ },+]);+```++## 3. Advanced Session Management++Sessions allow the model to maintain context across multiple interactions.++### Context and Quota++Each session has a maximum token limit. You can monitor usage via `session.contextUsage` and `session.contextWindow`. If the window overflows, the oldest messages (except the system prompt) are dropped.++### Cloning Sessions++Cloning is efficient for starting parallel conversations that share the same initial context (like a "system" personality) without re-initializing.++```javascript+const mainSession = await LanguageModel.create({+ initialPrompts: [{ role: 'system', content: 'You speak like a pirate.' }],+});++const branchA = await mainSession.clone();+const branchB = await mainSession.clone();+// Destroy the base after cloning — the clones own their own context from here.+mainSession.destroy();+```++### Restoring Past Sessions++While a native "restore" feature is in development, you can recreate a session by feeding previous history into `initialPrompts`.++**Note**: `localStorage` is unencrypted and persistent. Stored conversation history may include user PII — consider the privacy implications before persisting chat history.++```javascript+// || '[]' ensures JSON.parse never receives null when the key doesn't exist yet.+const history = JSON.parse(localStorage.getItem('chat_history') || '[]');+const session = await LanguageModel.create({+ initialPrompts: history, // Array of {role, content} objects+});+```++## 4. Structured Output with JSON Schema++To prevent the model from adding "chatter" (e.g., "Sure, here is your JSON:"), use a **JSON Schema** via the `responseConstraint` field. This ensures the output is valid JSON that can be parsed immediately.++### Example: Sentiment Classification++```javascript+// Pass the schema as a plain object — do not JSON.stringify() it first.+const schema = {+ type: 'object',+ properties: {+ rating: { type: 'number', minimum: 1, maximum: 5 },+ is_positive: { type: 'boolean' },+ },+ required: ['rating', 'is_positive'],+};++const result = await session.prompt(+ "Rate the following feedback: 'The food was great!'",+ { responseConstraint: schema },+);++const data = JSON.parse(result);+console.log(data.rating); // 5+```++### Constraints and Prefixes++You can guide the model further by prefilling the assistant's response using `prefix: true`.++````javascript+const character = await session.prompt([+ { role: 'user', content: 'Create a character sheet' },+ { role: 'assistant', content: '```json\n', prefix: true },+]);+````++## 5. Best Practices and Safety++- **Resource Cleanup**: Always call `session.destroy()` when a conversation is finished to free up memory.+- **Output Safety**: Model output is untrusted. Always write results to `textContent`, not `innerHTML`, to prevent XSS injection from malicious model output.+- Use a sanitizer like the native Sanitizer API or DOMPurify if you need to allow limited HTML.+- **Aborting Tasks**: Use `AbortController` to allow users to stop long-running generations. Pass the `signal` to `prompt()` or `promptStreaming()`, not to `LanguageModel.create()`.+- **Security**: Use Permission Policies to control access in iframes: `<iframe src="..." allow="language-model"></iframe>`.+- **Design**: Review the [People + AI Guidebook](https://pair.withgoogle.com/guidebook/) to ensure responsible AI implementation.++By combining structured outputs with robust session management, developers can build complex, stateful AI applications that run entirely on the user's device.++## 6. Fallback strategies++LanguageModel has limited availability.+Supported by: Chrome 148 (May 2026).+Unsupported in: Edge, Firefox, and Safari.++Before use, check if the LanguageModel object is available in the global scope:++```js+if ('LanguageModel' in self) {+ // The Prompt API is supported.+} else {+ // Execute fallback strategy+}+```++If the Prompt API is unsupported or availability checks return 'unavailable', you must gracefully fall back:++* Remote API Fallback: Redirect the detection request to a server endpoint or a cloud API (such as the Vertex AI Gemini API).+* Local API Fallback: Redirect the detection request to a local endpoint, for example, using Transformers.js.diff --git a/skills/modern-web-guidance/guides/built-in-ai/translator.md b/skills/modern-web-guidance/guides/built-in-ai/translator.mdindex 672ed9b..683d679 100644--- a/skills/modern-web-guidance/guides/built-in-ai/translator.md+++ b/skills/modern-web-guidance/guides/built-in-ai/translator.md@@ -101,7 +101,7 @@ The API supports a wide range of BCP 47 language codes: Here are the languages s- **hu**: Hungarian- **id**: Indonesian- **it**: Italian-- **iw**: Hebrew+- **he**: Hebrew- **ja**: Japanese- **kn**: Kannada- **ko**: Koreandiff --git a/skills/modern-web-guidance/guides/css-layout/usage-aware-component-variations.md b/skills/modern-web-guidance/guides/css-layout/usage-aware-component-variations.mdnew file mode 100644index 0000000..3d66a3f--- /dev/null+++ b/skills/modern-web-guidance/guides/css-layout/usage-aware-component-variations.md@@ -0,0 +1,108 @@+# Semantic Component Adaptation++Use style queries (`@container style()`) to trigger contextual variations without hardcoding what produces or reacts to each context. This reduces design system coupling and improves extensibility and component encapsulation.++For example, a `section.featured { --surface: featured }` rule can mark a context, and a landing page might also default to it via `main { --surface: featured }`. Components then opt in to react to `--surface: featured`: a card reveals a promotional badge, a button defaults to its filled variant, and so on.++Style queries let **both sides stay decoupled**: the featured surfaces never name the elements that adapt to them, and the components never inspect what produced the context. Either side can be extended independently — new components, new featured surfaces — without touching the other. Descendant selectors (e.g., `.featured .button`) force the opposite: the selector must encode both sides of the relationship and must change whenever either side does.++## When to use this guide++This guide covers *behavioral* changes: a component deciding **what to render, how to arrange itself, or which variant to present** in response to its context — hiding or showing a badge, switching layout direction, or swapping a button variant.++If instead you need *token-level* changes — density modes, themes, or other higher-order tokens that uniformly shift values like padding and color across many components — see `design-token-reactivity` (via `npx -y modern-web-guidance@latest retrieve "design-token-reactivity"`).++## Choosing the right tool++Reach for a style query when **both sides of a contextual relationship may change independently** — new elements may start producing the context, or new components may start reacting to it. The indirection pays for itself in extensibility and encapsulation, and style queries cross shadow DOM boundaries that descendant selectors cannot. When that flexibility isn't needed, prefer the simpler tool:++- **Descendant selectors** (`.toolbar .button`): a fixed, one-off relationship that isn't reusable or extensible. YAGNI applies — don't add indirection you won't use.+- **Size queries** (`@container (min-width: …)`): layout and density changes driven by available space, not semantic state.+- **Style queries** (`@container style(…)`): semantic state — what a component should render, arrange, or present in a given context.++## Implementation Directives++1. Define a semantic context flag using a CSS custom property on a container.+2. **DO NOT** set `container-type` for style queries; they query inherited custom properties on the nearest ancestor and don't require an explicit containment context.+3. **MANDATORY**: Use `@container style(--property: value)` to apply conditional styles to descendant elements. Style queries cannot match the element the property is set on — only its descendants.+4. **DO** prefer style queries over descendant selectors when the relationship must stay extensible or cross component/shadow DOM boundaries (see *Choosing the right tool* above) — but keep descendant selectors for fixed, one-off relationships where the indirection buys nothing.++## Implementation Example++```css+/* 1. Set the context on a layout container */+.featured {+ --surface: featured; /* Semantic context flag for children */+}++/* 2. Component reacts to inherited flag */+.button {+ /* Default: Outlined informational style */+ background: transparent;+ border: 1px solid currentColor;+}++.badge {+ /* Default: Hidden — only revealed in featured surfaces */+ display: none;+}++@container style(--surface: featured) {+ .button {+ /* Automatic switch to Filled promotional style */+ background: var(--brand-accent);+ color: white;+ border: none;+ }++ .badge {+ /* Reveal decorative elements only in featured context */+ display: block;+ }+}+```++## Fallback Strategies++Baseline status for Container style queries: Newly available. It's been Baseline since 2026-05-19.+Supported by: Chrome 111 (Mar 2023), Edge 111 (Mar 2023), Firefox 151 (May 2026), and Safari 18 (Sep 2024).++Until container style queries are widely available, layer them on as a progressive enhancement: ship a selector-based default that works everywhere, and let the style query override it when supported. Use `:where()` on the context selector so the style query (same specificity, later in source order) wins automatically.++```css+/* Default styles — work everywhere */+.button {+ background: transparent;+ border: 1px solid currentColor;+}++.badge {+ display: none;+}++/* Selector-based contextual styles — broad browser support */+:where(.featured) .button {+ background: var(--brand-accent);+ color: white;+ border: none;+}++:where(.featured) .badge {+ display: block;+}++/* Progressive enhancement: style queries override when supported */+@container style(--surface: featured) {+ .button {+ background: var(--brand-accent);+ color: white;+ border: none;+ }++ .badge {+ display: block;+ }+}+```++The selector fallback ties the contextual styling to a class name, which couples the component to its DOM placement. Once style queries are widely supported, the `:where()` rule can be removed.diff --git a/skills/modern-web-guidance/guides/user-experience/animate-to-intrinsic-sizes.md b/skills/modern-web-guidance/guides/css/animate-to-intrinsic-sizes.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/animate-to-intrinsic-sizes.mdrename to skills/modern-web-guidance/guides/css/animate-to-intrinsic-sizes.mddiff --git a/skills/modern-web-guidance/guides/user-experience/calculate-with-intrinsic-sizes.md b/skills/modern-web-guidance/guides/css/calculate-with-intrinsic-sizes.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/calculate-with-intrinsic-sizes.mdrename to skills/modern-web-guidance/guides/css/calculate-with-intrinsic-sizes.mddiff --git a/skills/modern-web-guidance/guides/user-experience/child-state-based-styling.md b/skills/modern-web-guidance/guides/css/child-state-based-styling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/child-state-based-styling.mdrename to skills/modern-web-guidance/guides/css/child-state-based-styling.mddiff --git a/skills/modern-web-guidance/guides/user-experience/content-based-styling.md b/skills/modern-web-guidance/guides/css/content-based-styling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/content-based-styling.mdrename to skills/modern-web-guidance/guides/css/content-based-styling.mddiff --git a/skills/modern-web-guidance/guides/css-layout/css-layout.md b/skills/modern-web-guidance/guides/css/css-layout.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/css-layout/css-layout.mdrename to skills/modern-web-guidance/guides/css/css-layout.mddiff --git a/skills/modern-web-guidance/guides/user-experience/design-token-reactivity.md b/skills/modern-web-guidance/guides/css/design-token-reactivity.mdsimilarity index 98%rename from skills/modern-web-guidance/guides/user-experience/design-token-reactivity.mdrename to skills/modern-web-guidance/guides/css/design-token-reactivity.mdindex 4ce7f9a..2c80be8 100644--- a/skills/modern-web-guidance/guides/user-experience/design-token-reactivity.md+++ b/skills/modern-web-guidance/guides/css/design-token-reactivity.md@@ -89,7 +89,7 @@ For core features, an alternate approach using selectors should be used. This ex}```-A major limitation of this fallback approach is that it does not support nesting elements with the `data-density` attribute set, since the selector specificity is the same, order of appearance will be used to determine the styles (i.e. `[data-density="spacious"]` will always take precendence over `[data-density="compact"]`).+A major limitation of this fallback approach is that it does not support nesting elements with the `data-density` attribute set, since the selector specificity is the same, order of appearance will be used to determine the styles (i.e. `[data-density="spacious"]` will always take precedence over `[data-density="compact"]`).### Using style queries as a progressive enhancementdiff --git a/skills/modern-web-guidance/guides/user-experience/dynamic-sibling-styling.md b/skills/modern-web-guidance/guides/css/dynamic-sibling-styling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/dynamic-sibling-styling.mdrename to skills/modern-web-guidance/guides/css/dynamic-sibling-styling.mddiff --git a/skills/modern-web-guidance/guides/user-experience/fluid-scaling.md b/skills/modern-web-guidance/guides/css/fluid-scaling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/fluid-scaling.mdrename to skills/modern-web-guidance/guides/css/fluid-scaling.mddiff --git a/skills/modern-web-guidance/guides/user-experience/individual-transform-properties.md b/skills/modern-web-guidance/guides/css/individual-transform-properties.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/individual-transform-properties.mdrename to skills/modern-web-guidance/guides/css/individual-transform-properties.mddiff --git a/skills/modern-web-guidance/guides/user-experience/overflow-clipping-control.md b/skills/modern-web-guidance/guides/css/overflow-clipping-control.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/overflow-clipping-control.mdrename to skills/modern-web-guidance/guides/css/overflow-clipping-control.mddiff --git a/skills/modern-web-guidance/guides/user-experience/reduce-style-repetition.md b/skills/modern-web-guidance/guides/css/reduce-style-repetition.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/reduce-style-repetition.mdrename to skills/modern-web-guidance/guides/css/reduce-style-repetition.mddiff --git a/skills/modern-web-guidance/guides/user-experience/size-aware-styling.md b/skills/modern-web-guidance/guides/css/size-aware-styling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/size-aware-styling.mdrename to skills/modern-web-guidance/guides/css/size-aware-styling.mddiff --git a/skills/modern-web-guidance/guides/user-experience/style-parent-with-has.md b/skills/modern-web-guidance/guides/css/style-parent-with-has.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/style-parent-with-has.mdrename to skills/modern-web-guidance/guides/css/style-parent-with-has.mddiff --git a/skills/modern-web-guidance/guides/user-experience/calculate-event-differentials.md b/skills/modern-web-guidance/guides/js/calculate-event-differentials.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/calculate-event-differentials.mdrename to skills/modern-web-guidance/guides/js/calculate-event-differentials.mddiff --git a/skills/modern-web-guidance/guides/user-experience/capture-location-agnostic-data.md b/skills/modern-web-guidance/guides/js/capture-location-agnostic-data.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/capture-location-agnostic-data.mdrename to skills/modern-web-guidance/guides/js/capture-location-agnostic-data.mddiff --git a/skills/modern-web-guidance/guides/user-experience/coordinate-global-events.md b/skills/modern-web-guidance/guides/js/coordinate-global-events.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/coordinate-global-events.mdrename to skills/modern-web-guidance/guides/js/coordinate-global-events.mddiff --git a/skills/modern-web-guidance/guides/user-experience/format-human-readable-durations.md b/skills/modern-web-guidance/guides/js/format-human-readable-durations.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/format-human-readable-durations.mdrename to skills/modern-web-guidance/guides/js/format-human-readable-durations.mddiff --git a/skills/modern-web-guidance/guides/user-experience/manage-recurring-intervals.md b/skills/modern-web-guidance/guides/js/manage-recurring-intervals.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/manage-recurring-intervals.mdrename to skills/modern-web-guidance/guides/js/manage-recurring-intervals.mddiff --git a/skills/modern-web-guidance/guides/user-experience/model-partial-time-concepts.md b/skills/modern-web-guidance/guides/js/model-partial-time-concepts.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/model-partial-time-concepts.mdrename to skills/modern-web-guidance/guides/js/model-partial-time-concepts.mddiff --git a/skills/modern-web-guidance/guides/user-experience/stabilize-reactive-state.md b/skills/modern-web-guidance/guides/js/stabilize-reactive-state.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/stabilize-reactive-state.mdrename to skills/modern-web-guidance/guides/js/stabilize-reactive-state.mddiff --git a/skills/modern-web-guidance/guides/user-experience/support-global-calendar-systems.md b/skills/modern-web-guidance/guides/js/support-global-calendar-systems.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/support-global-calendar-systems.mdrename to skills/modern-web-guidance/guides/js/support-global-calendar-systems.mddiff --git a/skills/modern-web-guidance/guides/user-experience/deliver-optimized-decorative-images.md b/skills/modern-web-guidance/guides/performance/deliver-optimized-decorative-images.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/deliver-optimized-decorative-images.mdrename to skills/modern-web-guidance/guides/performance/deliver-optimized-decorative-images.mddiff --git a/skills/modern-web-guidance/guides/user-experience/flicker-free-client-side-ab-testing.md b/skills/modern-web-guidance/guides/performance/flicker-free-client-side-ab-testing.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/flicker-free-client-side-ab-testing.mdrename to skills/modern-web-guidance/guides/performance/flicker-free-client-side-ab-testing.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkey-authentication.md b/skills/modern-web-guidance/guides/security/passkey-authentication.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkey-authentication.mdrename to skills/modern-web-guidance/guides/security/passkey-authentication.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkey-conditional-create.md b/skills/modern-web-guidance/guides/security/passkey-conditional-create.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkey-conditional-create.mdrename to skills/modern-web-guidance/guides/security/passkey-conditional-create.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkey-management.md b/skills/modern-web-guidance/guides/security/passkey-management.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkey-management.mdrename to skills/modern-web-guidance/guides/security/passkey-management.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkey-reauthentication.md b/skills/modern-web-guidance/guides/security/passkey-reauthentication.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkey-reauthentication.mdrename to skills/modern-web-guidance/guides/security/passkey-reauthentication.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkey-registration.md b/skills/modern-web-guidance/guides/security/passkey-registration.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkey-registration.mdrename to skills/modern-web-guidance/guides/security/passkey-registration.mddiff --git a/skills/modern-web-guidance/guides/passkeys/passkeys.md b/skills/modern-web-guidance/guides/security/passkeys.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/passkeys/passkeys.mdrename to skills/modern-web-guidance/guides/security/passkeys.mddiff --git a/skills/modern-web-guidance/guides/user-experience/carousel-slide-effects.md b/skills/modern-web-guidance/guides/ui-atoms/carousel-slide-effects.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/carousel-slide-effects.mdrename to skills/modern-web-guidance/guides/ui-atoms/carousel-slide-effects.mddiff --git a/skills/modern-web-guidance/guides/user-experience/component-specific-light-dark-theme.md b/skills/modern-web-guidance/guides/ui-atoms/component-specific-light-dark-theme.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/component-specific-light-dark-theme.mdrename to skills/modern-web-guidance/guides/ui-atoms/component-specific-light-dark-theme.mddiff --git a/skills/modern-web-guidance/guides/user-experience/position-aware-tooltips.md b/skills/modern-web-guidance/guides/ui-atoms/position-aware-tooltips.mdsimilarity index 75%rename from skills/modern-web-guidance/guides/user-experience/position-aware-tooltips.mdrename to skills/modern-web-guidance/guides/ui-atoms/position-aware-tooltips.mdindex 99790b8..ded9b70 100644--- a/skills/modern-web-guidance/guides/user-experience/position-aware-tooltips.md+++ b/skills/modern-web-guidance/guides/ui-atoms/position-aware-tooltips.md@@ -115,40 +115,42 @@ Positioning the arrow based on the applied fallback is a progressive enhancement}```-### Polyfilling the Popover Attribute+### Fallbacks & browser support for PopoverBaseline status for Popover: Newly available. It's been Baseline since 2025-01-27.Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-To support the `popover` attribute in older browsers, use the `@oddbird/popover-polyfill`.+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.-MANDATORY: Feature detect popover support by checking for the `popover` property on the `HTMLElement` prototype. Conditionally initialize the polyfill only if native support is missing.+**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.-**Option 1: Using a package manager**-Install the package (`npm install @oddbird/popover-polyfill`).+With a bundler or import map:-```javascript+```js// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.-if (!('popover' in HTMLElement.prototype)) {- import('@oddbird/popover-polyfill/fn').then(({ apply }) => {- apply();- });+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");}```-**Option 2: Manual installation without npm**-If you are not using a package manager, dynamically import the polyfill directly from a CDN (such as unpkg) inside a `<script type="module">`.+Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- // MANDATORY: Feature detect 'popover' on HTMLElement.prototype.- // Conditionally load the popover-polyfill from a CDN only in browsers lacking native support.- if (!('popover' in HTMLElement.prototype)) {- import('https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover-fn.js').then(({ apply }) => {- apply();- });+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.+Browsers without support for the Popover API also do not support anchor positioning, so the tooltip will appear in the center of the screen.\ No newline at end of filediff --git a/skills/modern-web-guidance/guides/user-experience/pull-to-reveal.md b/skills/modern-web-guidance/guides/ui-atoms/pull-to-reveal.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/pull-to-reveal.mdrename to skills/modern-web-guidance/guides/ui-atoms/pull-to-reveal.mddiff --git a/skills/modern-web-guidance/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md b/skills/modern-web-guidance/guides/ui-atoms/resilient-context-menus-and-nested-dropdowns.mdsimilarity index 74%rename from skills/modern-web-guidance/guides/user-experience/resilient-context-menus-and-nested-dropdowns.mdrename to skills/modern-web-guidance/guides/ui-atoms/resilient-context-menus-and-nested-dropdowns.mdindex df36255..6dc1fa1 100644--- a/skills/modern-web-guidance/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md+++ b/skills/modern-web-guidance/guides/ui-atoms/resilient-context-menus-and-nested-dropdowns.md@@ -60,19 +60,44 @@ To prevent the panel from being cut off at the edge of the screen, define "try t## Fallback strategies+### Fallbacks & browser support for Popover+Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-Popover must conditionally be polyfilled with the `@oddbird/popover-polyfill` polyfill.+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.++**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.++With a bundler or import map:++```js+// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");+}+```++Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- if(!HTMLElement.prototype.hasOwnProperty("popover")){- await import("https://unpkg.com/@oddbird/popover-polyfill@latest");+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.+Anchor positioning is not natively supported by any major browser yet.To support browsers without anchor positioning, you must set a reasonable position. By default popovers are centered in the middle of the screen, which may work for your use case.diff --git a/skills/modern-web-guidance/guides/user-experience/scroll-position-aware-elements.md b/skills/modern-web-guidance/guides/ui-atoms/scroll-position-aware-elements.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scroll-position-aware-elements.mdrename to skills/modern-web-guidance/guides/ui-atoms/scroll-position-aware-elements.mddiff --git a/skills/modern-web-guidance/guides/user-experience/scroll-progress-indicator.md b/skills/modern-web-guidance/guides/ui-atoms/scroll-progress-indicator.mdsimilarity index 98%rename from skills/modern-web-guidance/guides/user-experience/scroll-progress-indicator.mdrename to skills/modern-web-guidance/guides/ui-atoms/scroll-progress-indicator.mdindex fa2f922..83c6dcf 100644--- a/skills/modern-web-guidance/guides/user-experience/scroll-progress-indicator.md+++ b/skills/modern-web-guidance/guides/ui-atoms/scroll-progress-indicator.md@@ -41,7 +41,7 @@ This code grows the `#progress` element on scroll using an anonymous scroll-time}```-Because of its location in the DOM, the `scroll()` function will track its neareast ancestor scroller in the `block` direction, which here is the root scroller.+Because of its location in the DOM, the `scroll()` function will track its nearest ancestor scroller in the `block` direction, which here is the root scroller.```html<body>diff --git a/skills/modern-web-guidance/guides/user-experience/scrollability-affordance-hints.md b/skills/modern-web-guidance/guides/ui-atoms/scrollability-affordance-hints.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scrollability-affordance-hints.mdrename to skills/modern-web-guidance/guides/ui-atoms/scrollability-affordance-hints.mddiff --git a/skills/modern-web-guidance/guides/user-experience/shrinking-header-on-scroll.md b/skills/modern-web-guidance/guides/ui-atoms/shrinking-header-on-scroll.mdsimilarity index 99%rename from skills/modern-web-guidance/guides/user-experience/shrinking-header-on-scroll.mdrename to skills/modern-web-guidance/guides/ui-atoms/shrinking-header-on-scroll.mdindex bcc4e9c..6a4b5c7 100644--- a/skills/modern-web-guidance/guides/user-experience/shrinking-header-on-scroll.md+++ b/skills/modern-web-guidance/guides/ui-atoms/shrinking-header-on-scroll.md@@ -1,4 +1,4 @@-# Shrinking headder on scroll+# Shrinking header on scrollA shrinking header on scroll is a common UI pattern where a fixed header element at the top of the page smoothly transitions to a smaller size as the user scrolls down. This effect is often used to maximize screen real estate for the main content while keeping essential navigation or branding elements accessible. With CSS scroll-driven animations, this effect can be achieved in a declarative and performant way, by linking an animation to the scroll position of the document.diff --git a/skills/modern-web-guidance/guides/user-experience/anchor-positioning-tab-underline.md b/skills/modern-web-guidance/guides/ui-behaviors/anchor-positioning-tab-underline.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/anchor-positioning-tab-underline.mdrename to skills/modern-web-guidance/guides/ui-behaviors/anchor-positioning-tab-underline.mddiff --git a/skills/modern-web-guidance/guides/user-experience/animate-element-entry-exit.md b/skills/modern-web-guidance/guides/ui-behaviors/animate-element-entry-exit.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/animate-element-entry-exit.mdrename to skills/modern-web-guidance/guides/ui-behaviors/animate-element-entry-exit.mddiff --git a/skills/modern-web-guidance/guides/user-experience/animate-to-from-top-layer.md b/skills/modern-web-guidance/guides/ui-behaviors/animate-to-from-top-layer.mdsimilarity index 75%rename from skills/modern-web-guidance/guides/user-experience/animate-to-from-top-layer.mdrename to skills/modern-web-guidance/guides/ui-behaviors/animate-to-from-top-layer.mdindex f5f4bd7..274ff28 100644--- a/skills/modern-web-guidance/guides/user-experience/animate-to-from-top-layer.md+++ b/skills/modern-web-guidance/guides/ui-behaviors/animate-to-from-top-layer.md@@ -96,7 +96,7 @@ dialog[open]::backdrop,## Fallback strategies-#### Top-layer animation features+### Top-layer animation featuresBaseline status for @starting-style: Newly available. It's been Baseline since 2024-08-06.Supported by: Chrome 117 (Sep 2023), Edge 117 (Sep 2023), Firefox 129 (Aug 2024), and Safari 17.5 (May 2024).@@ -122,19 +122,40 @@ if (!supportsTopLayerAnimation) {}```-#### popover+### Fallbacks & browser support for PopoverBaseline status for Popover: Newly available. It's been Baseline since 2025-01-27.Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-If the browser does not support Popover, use the `@oddbird/popover-polyfill`:+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.++**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.++With a bundler or import map:++```js+// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");+}+```++Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- if (!HTMLElement.prototype.hasOwnProperty('popover')) {- await import('https://unpkg.com/@oddbird/popover-polyfill');+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```-Alternatively, for legacy support without a polyfill, use `position: fixed` and manually calculate coordinates via JavaScript `getBoundingClientRect()`.+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.diff --git a/skills/modern-web-guidance/guides/user-experience/carousel-snap-highlights.md b/skills/modern-web-guidance/guides/ui-behaviors/carousel-snap-highlights.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/carousel-snap-highlights.mdrename to skills/modern-web-guidance/guides/ui-behaviors/carousel-snap-highlights.mddiff --git a/skills/modern-web-guidance/guides/user-experience/consistent-cross-document-transitions.md b/skills/modern-web-guidance/guides/ui-behaviors/consistent-cross-document-transitions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/consistent-cross-document-transitions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/consistent-cross-document-transitions.mddiff --git a/skills/modern-web-guidance/guides/user-experience/cross-document-transitions.md b/skills/modern-web-guidance/guides/ui-behaviors/cross-document-transitions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/cross-document-transitions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/cross-document-transitions.mddiff --git a/skills/modern-web-guidance/guides/user-experience/custom-button-actions.md b/skills/modern-web-guidance/guides/ui-behaviors/custom-button-actions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/custom-button-actions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/custom-button-actions.mddiff --git a/skills/modern-web-guidance/guides/user-experience/declarative-dialog-popover-control.md b/skills/modern-web-guidance/guides/ui-behaviors/declarative-dialog-popover-control.mdsimilarity index 85%rename from skills/modern-web-guidance/guides/user-experience/declarative-dialog-popover-control.mdrename to skills/modern-web-guidance/guides/ui-behaviors/declarative-dialog-popover-control.mdindex 9b56bcc..e6d6e7d 100644--- a/skills/modern-web-guidance/guides/user-experience/declarative-dialog-popover-control.md+++ b/skills/modern-web-guidance/guides/ui-behaviors/declarative-dialog-popover-control.md@@ -64,8 +64,6 @@ Unlike popovers, modal dialogs typically use separate buttons for opening and clBaseline status for Invoker commands: Newly available. It's been Baseline since 2025-12-12.Supported by: Chrome 135 (Apr 2025), Edge 135 (Apr 2025), Firefox 144 (Oct 2025), and Safari 26.2 (Dec 2025).-Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.-Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).Because Invoker Commands and Popovers are not yet universally supported, you MUST use polyfills as fallbacks for older browsers.@@ -195,44 +193,40 @@ document.getElementById('action-target').addEventListener('command', (event) =>});```-### Polyfilling the Popover Attribute+### Fallbacks & browser support for Popover-To support the `popover` attribute in older browsers, use the `@oddbird/popover-polyfill`.+Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.+Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-MANDATORY: Feature detect popover support by checking for the `popover` property on the `HTMLElement` prototype. Conditionally initialize the polyfill only if native support is missing.+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.-**Option 1: Using a bundler**-Install the package via npm (`npm install @oddbird/popover-polyfill`). This method requires a bundler or import maps to resolve the module path.+**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.-```javascript+With a bundler or import map:++```js// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.-if (!('popover' in HTMLElement.prototype)) {- import('@oddbird/popover-polyfill/fn').then(({ apply }) => {- apply();- });+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");}```-**Option 2: Using a CDN**-For projects without a bundler, dynamically import the polyfill directly from a CDN inside a `<script type="module">`.+Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- // MANDATORY: Feature detect 'popover' on HTMLElement.prototype.- // Conditionally load the popover-polyfill from a CDN only in browsers lacking native support.- if (!('popover' in HTMLElement.prototype)) {- import('https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover-fn.js').then(({ apply }) => {- apply();- });+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```-**Popover Polyfill Limitations & Styling Caveats**-MANDATORY: Use `:is()` or `:where()` to combine `:popover-open` with the corresponding polyfill class, otherwise browsers that do not support `:popover-open` will throw away the entire rule.+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:```css[popover]:is(:popover-open, .\:popover-open) {display: block;}```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.diff --git a/skills/modern-web-guidance/guides/user-experience/directional-navigation-transitions.md b/skills/modern-web-guidance/guides/ui-behaviors/directional-navigation-transitions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/directional-navigation-transitions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/directional-navigation-transitions.mddiff --git a/skills/modern-web-guidance/guides/user-experience/dynamic-sibling-animations.md b/skills/modern-web-guidance/guides/ui-behaviors/dynamic-sibling-animations.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/dynamic-sibling-animations.mdrename to skills/modern-web-guidance/guides/ui-behaviors/dynamic-sibling-animations.mddiff --git a/skills/modern-web-guidance/guides/user-experience/group-element-transitions.md b/skills/modern-web-guidance/guides/ui-behaviors/group-element-transitions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/group-element-transitions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/group-element-transitions.mddiff --git a/skills/modern-web-guidance/guides/css/highlight-text-ranges.md b/skills/modern-web-guidance/guides/ui-behaviors/highlight-text-ranges.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/css/highlight-text-ranges.mdrename to skills/modern-web-guidance/guides/ui-behaviors/highlight-text-ranges.mddiff --git a/skills/modern-web-guidance/guides/user-experience/interactive-content-reveal.md b/skills/modern-web-guidance/guides/ui-behaviors/interactive-content-reveal.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/interactive-content-reveal.mdrename to skills/modern-web-guidance/guides/ui-behaviors/interactive-content-reveal.mddiff --git a/skills/modern-web-guidance/guides/user-experience/interest-triggered-action-previews.md b/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-action-previews.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/interest-triggered-action-previews.mdrename to skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-action-previews.mddiff --git a/skills/modern-web-guidance/guides/user-experience/interest-triggered-tooltips.md b/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-tooltips.mdsimilarity index 77%rename from skills/modern-web-guidance/guides/user-experience/interest-triggered-tooltips.mdrename to skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-tooltips.mdindex 09ebe5d..f708f4b 100644--- a/skills/modern-web-guidance/guides/user-experience/interest-triggered-tooltips.md+++ b/skills/modern-web-guidance/guides/ui-behaviors/interest-triggered-tooltips.md@@ -88,22 +88,50 @@ Interest invokers must be conditionally polyfilled using the `interestfor` polyf</script>```+### Fallbacks & browser support for Popover+Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-popover="hint" has limited availability.-Supported by: Chrome 133 (Feb 2025), Edge 133 (Feb 2025), and Firefox 149 (Mar 2026).-Unsupported in: Safari.-Popover and popover hint must conditionally be polyfilled with the `@oddbird/popover-polyfill` polyfill. The hint behavior will not be polyfilled in browsers that support `popover` but not `popover="hint"`. For those browsers, a tooltip opened via focus may stay open when a second tooltip opened via hover.+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.++**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.++With a bundler or import map:++```js+// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");+}+```++Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- if(!HTMLElement.prototype.hasOwnProperty("popover")){- await import("https://unpkg.com/@oddbird/popover-polyfill@latest");+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.++popover="hint" has limited availability.+Supported by: Chrome 133 (Feb 2025), Edge 133 (Feb 2025), and Firefox 149 (Mar 2026).+Unsupported in: Safari.++The `popover-polyfill` does not polyfill the hint behavior in browsers that support `popover` but not `popover="hint"`. For those browsers, a tooltip opened via focus may stay open when a second tooltip opened via hover.+Anchor positioning is not natively supported by any major browser yet.**MANDATORY:** To support browsers without anchor positioning, you MUST use the `@oddbird/css-anchor-positioning` polyfill. It does not support implicit anchors, so you MUST add anchor names to the trigger. Additionally, `position-area` is not supported on popovers by the polyfill, so you MUST use `anchor()` on the desired insets.diff --git a/skills/modern-web-guidance/guides/user-experience/light-dismiss-a-dialog.md b/skills/modern-web-guidance/guides/ui-behaviors/light-dismiss-a-dialog.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/light-dismiss-a-dialog.mdrename to skills/modern-web-guidance/guides/ui-behaviors/light-dismiss-a-dialog.mddiff --git a/skills/modern-web-guidance/guides/user-experience/move-dom-element-without-losing-state.md b/skills/modern-web-guidance/guides/ui-behaviors/move-dom-element-without-losing-state.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/move-dom-element-without-losing-state.mdrename to skills/modern-web-guidance/guides/ui-behaviors/move-dom-element-without-losing-state.mddiff --git a/skills/modern-web-guidance/guides/user-experience/parallax-scroll-effects.md b/skills/modern-web-guidance/guides/ui-behaviors/parallax-scroll-effects.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/parallax-scroll-effects.mdrename to skills/modern-web-guidance/guides/ui-behaviors/parallax-scroll-effects.mddiff --git a/skills/modern-web-guidance/guides/user-experience/persistent-top-layer-ui.md b/skills/modern-web-guidance/guides/ui-behaviors/persistent-top-layer-ui.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/persistent-top-layer-ui.mdrename to skills/modern-web-guidance/guides/ui-behaviors/persistent-top-layer-ui.mddiff --git a/skills/modern-web-guidance/guides/user-experience/physics-based-easing.md b/skills/modern-web-guidance/guides/ui-behaviors/physics-based-easing.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/physics-based-easing.mdrename to skills/modern-web-guidance/guides/ui-behaviors/physics-based-easing.mddiff --git a/skills/modern-web-guidance/guides/user-experience/platform-controls-dismiss-dialog.md b/skills/modern-web-guidance/guides/ui-behaviors/platform-controls-dismiss-dialog.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/platform-controls-dismiss-dialog.mdrename to skills/modern-web-guidance/guides/ui-behaviors/platform-controls-dismiss-dialog.mddiff --git a/skills/modern-web-guidance/guides/user-experience/same-document-transitions.md b/skills/modern-web-guidance/guides/ui-behaviors/same-document-transitions.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/same-document-transitions.mdrename to skills/modern-web-guidance/guides/ui-behaviors/same-document-transitions.mddiff --git a/skills/modern-web-guidance/guides/user-experience/scroll-entry-exit-effects.md b/skills/modern-web-guidance/guides/ui-behaviors/scroll-entry-exit-effects.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scroll-entry-exit-effects.mdrename to skills/modern-web-guidance/guides/ui-behaviors/scroll-entry-exit-effects.mddiff --git a/skills/modern-web-guidance/guides/user-experience/scroll-snap-realtime-feedback.md b/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-realtime-feedback.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scroll-snap-realtime-feedback.mdrename to skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-realtime-feedback.mddiff --git a/skills/modern-web-guidance/guides/user-experience/scroll-snap-state-sync.md b/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-state-sync.mdsimilarity index 98%rename from skills/modern-web-guidance/guides/user-experience/scroll-snap-state-sync.mdrename to skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-state-sync.mdindex a1f30f6..8704648 100644--- a/skills/modern-web-guidance/guides/user-experience/scroll-snap-state-sync.md+++ b/skills/modern-web-guidance/guides/ui-behaviors/scroll-snap-state-sync.md@@ -74,7 +74,7 @@ if (!('onscrollsnapchange' in HTMLElement.prototype)) {const topEntry = [...headers].reduce((currentTop, header) => {// Use the bottom to handle scrolling up, when the top is still offscreenconst {bottom} = header.getBoundingClientRect();- // Don't match if the header's bottom is aboce the scrollport+ // Don't match if the header's bottom is above the scrollportif (bottom < 0) return;if (!currentTop) return header;return bottom <diff --git a/skills/modern-web-guidance/guides/user-experience/scroll-target-on-load.md b/skills/modern-web-guidance/guides/ui-behaviors/scroll-target-on-load.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scroll-target-on-load.mdrename to skills/modern-web-guidance/guides/ui-behaviors/scroll-target-on-load.mddiff --git a/skills/modern-web-guidance/guides/user-experience/scrollytelling.md b/skills/modern-web-guidance/guides/ui-behaviors/scrollytelling.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/scrollytelling.mdrename to skills/modern-web-guidance/guides/ui-behaviors/scrollytelling.mddiff --git a/skills/modern-web-guidance/guides/user-experience/search-hidden-content.md b/skills/modern-web-guidance/guides/ui-behaviors/search-hidden-content.mdsimilarity index 98%rename from skills/modern-web-guidance/guides/user-experience/search-hidden-content.mdrename to skills/modern-web-guidance/guides/ui-behaviors/search-hidden-content.mdindex 212685c..36e1361 100644--- a/skills/modern-web-guidance/guides/user-experience/search-hidden-content.md+++ b/skills/modern-web-guidance/guides/ui-behaviors/search-hidden-content.md@@ -117,7 +117,7 @@ accordion.addEventListener('beforematch', (e) => {The `<details>` element is Baseline Widely available, so a fallback strategy is not required.-The `hidden="until-found"` attribute is not yet Baseline Widely available, but it can be safely used with a fallback in unsupporting browsers. **DO NOT** avoid `hidden="until-found"` because of missing browser support, as its accessiblity benefits far outweigh the cost of implementing a fallback.+The `hidden="until-found"` attribute is not yet Baseline Widely available, but it can be safely used with a fallback in unsupporting browsers. **DO NOT** avoid `hidden="until-found"` because of missing browser support, as its accessibility benefits far outweigh the cost of implementing a fallback.#### `hidden="until-found"` fallbackdiff --git a/skills/modern-web-guidance/guides/user-experience/swipe-to-remove.md b/skills/modern-web-guidance/guides/ui-behaviors/swipe-to-remove.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/swipe-to-remove.mdrename to skills/modern-web-guidance/guides/ui-behaviors/swipe-to-remove.mddiff --git a/skills/modern-web-guidance/guides/user-experience/navigation-drawer.md b/skills/modern-web-guidance/guides/ui-components/navigation-drawer.mdsimilarity index 97%rename from skills/modern-web-guidance/guides/user-experience/navigation-drawer.mdrename to skills/modern-web-guidance/guides/ui-components/navigation-drawer.mdindex ccbebe3..a648602 100644--- a/skills/modern-web-guidance/guides/user-experience/navigation-drawer.md+++ b/skills/modern-web-guidance/guides/ui-components/navigation-drawer.md@@ -76,7 +76,7 @@ The popover must cover the whole viewport so its `::backdrop` dims the entire paoverflow: visible;}-/* Style the popover's ::backdrop to achive the overlay effect and+/* Style the popover's ::backdrop to achieve the overlay effect andprovide visual affordances indicating that the rest of the page is inert */.Drawer::backdrop {background: #000;@@ -287,9 +287,6 @@ document.addEventListener('keydown', (event) => {### Fallback strategies-Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.-Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-The drawer's core mechanics — scroll snap, `IntersectionObserver`, and `inert` — are all Baseline Widely available and required for the component to function. The popover API, the scroll-driven animation that fades the backdrop, and `scroll-initial-target` are progressive enhancements with simple fallbacks that can be easily implemented if wide browser support is required.#### Backdrop fade fallback (no `animation-timeline` support):@@ -344,7 +341,7 @@ async function openDrawer() {Baseline status for Registered custom properties: Newly available. It's been Baseline since 2024-07-09.Supported by: Chrome 85 (Aug 2020), Edge 85 (Aug 2020), Firefox 128 (Jul 2024), and Safari 16.4 (Mar 2023).-`@property` is only needed because the scroll-driven animation interpolates `--drawer-backdrop` between keyframes — without registration, the property would be treated as a string and would jump between 0 and 1 with no fade. If the scroll-driven animation fallback above is in place, that JavaScript writes a fresh numeric string to `--drawer-backdrop` on every scroll frame and never interpolates, so no seprarate `@property` fallback is needed since all browsers that support scroll-driven animations also support `@property`.+`@property` is only needed because the scroll-driven animation interpolates `--drawer-backdrop` between keyframes — without registration, the property would be treated as a string and would jump between 0 and 1 with no fade. If the scroll-driven animation fallback above is in place, that JavaScript writes a fresh numeric string to `--drawer-backdrop` on every scroll frame and never interpolates, so no separate `@property` fallback is needed since all browsers that support scroll-driven animations also support `@property`.#### Popover API fallback (no `popover` attribute support):diff --git a/skills/modern-web-guidance/guides/user-experience/persistent-app-tours.md b/skills/modern-web-guidance/guides/ui-components/persistent-app-tours.mdsimilarity index 68%rename from skills/modern-web-guidance/guides/user-experience/persistent-app-tours.mdrename to skills/modern-web-guidance/guides/ui-components/persistent-app-tours.mdindex 7ae6bb2..3d6d8fa 100644--- a/skills/modern-web-guidance/guides/user-experience/persistent-app-tours.md+++ b/skills/modern-web-guidance/guides/ui-components/persistent-app-tours.md@@ -54,20 +54,43 @@ tourStep.querySelector('button').focus();### Fallback strategies+### Fallbacks & browser support for Popover+Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).-If the browser does not support Popover, use the `@oddbird/popover-polyfill`:+The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.++**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.++With a bundler or import map:++```js+// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");+}+```++Without a bundler, import from a CDN inside a `<script type="module">`:```html<script type="module">- if (!HTMLElement.prototype.hasOwnProperty('popover')) {- await import('https://unpkg.com/@oddbird/popover-polyfill');+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");}</script>```-Alternatively, for legacy support without a polyfill, use `position: fixed` and manually calculate coordinates via JavaScript `getBoundingClientRect()`.+**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.#### anchor-positioningdiff --git a/skills/modern-web-guidance/guides/ui-components/persistent-toast-notifications.md b/skills/modern-web-guidance/guides/ui-components/persistent-toast-notifications.mdnew file mode 100644index 0000000..b188517--- /dev/null+++ b/skills/modern-web-guidance/guides/ui-components/persistent-toast-notifications.md@@ -0,0 +1,64 @@+# Creating Toast Notifications++Toast notifications are transient status messages. Unlike menus, they should not close when a user interacts with other parts of the page. The popover="manual" state is ideal because it lacks "light-dismiss" behavior and allows multiple notifications to coexist.++### Implementation Guidelines++* **MANDATORY:** Use popover="manual" so the notification stays visible until explicitly closed or timed out by a script.+* **DO** use a container to manage the stacking of multiple toasts. Since popovers in the Top Layer ignore parent z-index, you must position them individually or within a common layout group.+* **DO** use sibling-index() to add margin between toast notifications so that items lower in the stack are visible.+* **DO** provide an explicit "Close" button within the toast using popovertargetaction="hide".+* **DO** use JavaScript for auto-dismissal timers (e.g., calling hidePopover() after 3000ms).+* **DO** utilize transition-behavior: allow-discrete to animate the entry and exit from the Top Layer.++### Fallback Strategies++### Fallbacks & browser support for Popover++Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.+Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).++The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.++**Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.++With a bundler or import map:++```js+// MANDATORY: Feature detect 'popover' on HTMLElement.prototype.+if (!("popover" in HTMLElement.prototype)) {+ import("@oddbird/popover-polyfill");+}+```++Without a bundler, import from a CDN inside a `<script type="module">`:++```html+<script type="module">+ if (!("popover" in HTMLElement.prototype)) {+ import("https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js");+ }+</script>+```++**Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:++```css+[popover]:is(:popover-open, .\:popover-open) {+ display: block;+}+```++Alternatively, for a legacy fallback without a polyfill, use `position: fixed` and manually calculate coordinates via `getBoundingClientRect()` or rely on default positioning with `inset: auto` if that's acceptable for the use case.++#### sibling-index()++* **Guidance:** If sibling-index() is not supported, use the `+` operator to add margin manually. I.e. `popover + popover { margin-top: 1rem }`++#### anchor-positioning++* **Guidance:** Use the [CSS Anchor Positioning Polyfill](https://github.com/oddbird/css-anchor-positioning). For a non-polyfill fallback, default the tooltip to a fixed position at the bottom of the viewport using `@supports not (anchor-name: --foo)`.++#### transition-behavior++* **Guidance:** If transition-behavior is not supported, use JavaScript to add animation via classes as the toast element transitions in and out.\ No newline at end of filediff --git a/skills/modern-web-guidance/guides/user-experience/stack-drill-down.md b/skills/modern-web-guidance/guides/ui-components/stack-drill-down.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/stack-drill-down.mdrename to skills/modern-web-guidance/guides/ui-components/stack-drill-down.mddiff --git a/skills/modern-web-guidance/guides/user-experience/persistent-toast-notifications.md b/skills/modern-web-guidance/guides/user-experience/persistent-toast-notifications.mddeleted file mode 100644index 51d8492..0000000--- a/skills/modern-web-guidance/guides/user-experience/persistent-toast-notifications.md+++ /dev/null@@ -1,30 +0,0 @@-# Creating Toast Notifications--Toast notifications are transient status messages. Unlike menus, they should not close when a user interacts with other parts of the page. The popover="manual" state is ideal because it lacks "light-dismiss" behavior and allows multiple notifications to coexist.--### Implementation Guidelines--* **MANDATORY:** Use popover="manual" so the notification stays visible until explicitly closed or timed out by a script.-* **DO** use a container to manage the stacking of multiple toasts. Since popovers in the Top Layer ignore parent z-index, you must position them individually or within a common layout group.-* **DO** use sibling-index() to add margin between toast notifications so that items lower in the stack are visible.-* **DO** provide an explicit "Close" button within the toast using popovertargetaction="hide".-* **DO** use JavaScript for auto-dismissal timers (e.g., calling hidePopover() after 3000ms).-* **DO** utilize transition-behavior: allow-discrete to animate the entry and exit from the Top Layer.--### Fallback Strategies--#### popover--* **Guidance:** Use the [Popover Polyfill](https://github.com/oddbird/popover-polyfill). For legacy browsers, fall back to a fixed-position div with a high z-index.--#### sibling-index()--* **Guidance:** If sibling-index() is not supported, use the `+` operator to add margin manually. I.e. `popover + popover { margin-top: 1rem }`--#### anchor-positioning--* **Guidance:** Use the [CSS Anchor Positioning Polyfill](https://github.com/oddbird/css-anchor-positioning). For a non-polyfill fallback, default the tooltip to a fixed position at the bottom of the viewport using `@supports not (anchor-name: --foo)`.--#### transition-behavior--* **Guidance:** If transition-behavior is not supported, use JavaScript to add animation via classes as the toast element transitions in and out.\ No newline at end of filediff --git a/skills/modern-web-guidance/guides/user-experience/adapt-scrollbar-to-contrast-preferences.md b/skills/modern-web-guidance/guides/visual-design/adapt-scrollbar-to-contrast-preferences.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/adapt-scrollbar-to-contrast-preferences.mdrename to skills/modern-web-guidance/guides/visual-design/adapt-scrollbar-to-contrast-preferences.mddiff --git a/skills/modern-web-guidance/guides/user-experience/apply-webgl-shaders.md b/skills/modern-web-guidance/guides/visual-design/apply-webgl-shaders.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/apply-webgl-shaders.mdrename to skills/modern-web-guidance/guides/visual-design/apply-webgl-shaders.mddiff --git a/skills/modern-web-guidance/guides/user-experience/complex-shapes.md b/skills/modern-web-guidance/guides/visual-design/complex-shapes.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/complex-shapes.mdrename to skills/modern-web-guidance/guides/visual-design/complex-shapes.mddiff --git a/skills/modern-web-guidance/guides/user-experience/customize-scrollbar-color-and-thickness.md b/skills/modern-web-guidance/guides/visual-design/customize-scrollbar-color-and-thickness.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/customize-scrollbar-color-and-thickness.mdrename to skills/modern-web-guidance/guides/visual-design/customize-scrollbar-color-and-thickness.mddiff --git a/skills/modern-web-guidance/guides/user-experience/dark-mode.md b/skills/modern-web-guidance/guides/visual-design/dark-mode.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/dark-mode.mdrename to skills/modern-web-guidance/guides/visual-design/dark-mode.mddiff --git a/skills/modern-web-guidance/guides/user-experience/export-html-media-from-canvas.md b/skills/modern-web-guidance/guides/visual-design/export-html-media-from-canvas.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/export-html-media-from-canvas.mdrename to skills/modern-web-guidance/guides/visual-design/export-html-media-from-canvas.mddiff --git a/skills/modern-web-guidance/guides/user-experience/expose-canvas-content-to-browser-features.md b/skills/modern-web-guidance/guides/visual-design/expose-canvas-content-to-browser-features.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/expose-canvas-content-to-browser-features.mdrename to skills/modern-web-guidance/guides/visual-design/expose-canvas-content-to-browser-features.mddiff --git a/skills/modern-web-guidance/guides/user-experience/improve-text-layout-and-legibility.md b/skills/modern-web-guidance/guides/visual-design/improve-text-layout-and-legibility.mdsimilarity index 95%rename from skills/modern-web-guidance/guides/user-experience/improve-text-layout-and-legibility.mdrename to skills/modern-web-guidance/guides/visual-design/improve-text-layout-and-legibility.mdindex ea75edc..c1ae4a2 100644--- a/skills/modern-web-guidance/guides/user-experience/improve-text-layout-and-legibility.md+++ b/skills/modern-web-guidance/guides/visual-design/improve-text-layout-and-legibility.md@@ -1,6 +1,6 @@# Improve Text Layout and Legibility-The layout of text, particularly at the ends of lines and and ends of paragraphs, can impact the legibility and aesthetic appeal of a page. CSS provides several text wrapping options that can improve specific use cases.+The layout of text, particularly at the ends of lines and ends of paragraphs, can impact the legibility and aesthetic appeal of a page. CSS provides several text wrapping options that can improve specific use cases.For short text blocks like headings, use `text-wrap: balance`. This property instructs the browser to distribute text as evenly as possible across lines, creating a more symmetrical appearance.diff --git a/skills/modern-web-guidance/guides/user-experience/interactive-content-in-3d-scenes.md b/skills/modern-web-guidance/guides/visual-design/interactive-content-in-3d-scenes.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/interactive-content-in-3d-scenes.mdrename to skills/modern-web-guidance/guides/visual-design/interactive-content-in-3d-scenes.mddiff --git a/skills/modern-web-guidance/guides/user-experience/precise-text-alignment.md b/skills/modern-web-guidance/guides/visual-design/precise-text-alignment.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/precise-text-alignment.mdrename to skills/modern-web-guidance/guides/visual-design/precise-text-alignment.mddiff --git a/skills/modern-web-guidance/guides/user-experience/prevent-text-wrapping.md b/skills/modern-web-guidance/guides/visual-design/prevent-text-wrapping.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/prevent-text-wrapping.mdrename to skills/modern-web-guidance/guides/visual-design/prevent-text-wrapping.mddiff --git a/skills/modern-web-guidance/guides/user-experience/shaped-cutouts.md b/skills/modern-web-guidance/guides/visual-design/shaped-cutouts.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/shaped-cutouts.mdrename to skills/modern-web-guidance/guides/visual-design/shaped-cutouts.mddiff --git a/skills/modern-web-guidance/guides/user-experience/soft-edge-content-fade.md b/skills/modern-web-guidance/guides/visual-design/soft-edge-content-fade.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/soft-edge-content-fade.mdrename to skills/modern-web-guidance/guides/visual-design/soft-edge-content-fade.mddiff --git a/skills/modern-web-guidance/guides/user-experience/visually-stable-font-fallbacks.md b/skills/modern-web-guidance/guides/visual-design/visually-stable-font-fallbacks.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/visually-stable-font-fallbacks.mdrename to skills/modern-web-guidance/guides/visual-design/visually-stable-font-fallbacks.mddiff --git a/skills/modern-web-guidance/guides/user-experience/visually-stable-mixed-fonts.md b/skills/modern-web-guidance/guides/visual-design/visually-stable-mixed-fonts.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/visually-stable-mixed-fonts.mdrename to skills/modern-web-guidance/guides/visual-design/visually-stable-mixed-fonts.mddiff --git a/skills/modern-web-guidance/guides/user-experience/visually-texture-content.md b/skills/modern-web-guidance/guides/visual-design/visually-texture-content.mdsimilarity index 100%rename from skills/modern-web-guidance/guides/user-experience/visually-texture-content.mdrename to skills/modern-web-guidance/guides/visual-design/visually-texture-content.mddiff --git a/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md b/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.mdindex bc3944e..94e0273 100644--- a/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md+++ b/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md@@ -11,7 +11,7 @@ WebMCP does not provide an `unregisterTool()` method. To unregister a tool, you```javascriptconst controller = new AbortController();-document.modelContext.registerTool({+await document.modelContext.registerTool({name: "get_user_preferences",description: "Retrieves the user's saved preferences.",inputSchema: { type: "object", properties: {} },@@ -31,7 +31,7 @@ controller.abort();Parameters (params) are defined using the `inputSchema` property. This must be a **JSON Schema** object that describes the structured data the tool expects.```javascript-document.modelContext.registerTool({+await document.modelContext.registerTool({name: "calculate_area",description: "Calculates the area of a rectangle.",inputSchema: {