Skip to content

Keep your coding agent up to date with the latest web best practices

Release v0.0.83

github-actions[bot]7e15ee67d738
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 2a64f1b..737deb5 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -8,7 +8,7 @@
"name": "modern-web-guidance",
"source": "./",
"description": "Google Chrome's agent skills collection",
- "version": "0.0.82"
+ "version": "0.0.83"
}
]
}
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index 8defa71..83dc8c8 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "modern-web-guidance",
"description": "Google Chrome's agent skills collection",
- "version": "0.0.82",
+ "version": "0.0.83",
"author": {
"name": "Google Chrome"
}
diff --git a/README.md b/README.md
index 7570b96..ef8a50f 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
This curated collection of skills, tools, and AI-ready documentation injects Chrome's web platform knowledge directly into your workflow, ensuring your coding agent builds apps that are modern, fast, and secure by default.
-#### Skill Coverage in `v0.0.82`
+#### Skill Coverage in `v0.0.83`
<details>
<summary><strong>79 web features with implementation guidance from Chrome's experts</strong>: `::backdrop`, `:autofill`, `:has()`, `:not()`, `:user-valid and :user-invalid`, `@starting-style`, `&lt;details>`, `&lt;dialog closedby>`, `&lt;dialog>`, `&lt;link rel="expect">`, `&lt;link rel="preload">`, `AbortController and AbortSignal`, `accent-color`, `Active view transition`, `Anchor positioning`, `blocking="render"`, `calc-size()`, `color-scheme`, `Container queries`, `content-visibility`, `Cross-document view transitions`, `Customizable &lt;select>`, `Email, telephone, and URL &lt;input> types`, `enterkeyhint`, `Fetch`, `Fetch priority`, `fetchLater`, `field-sizing`, `font-size-adjust`, `Form-associated WebMCP attributes`, `hidden="until-found"`, `image-set()`, `Individual transform properties`, `inert`, `inputmode`, `Interest invokers`, `interpolate-size`, `Intersection observer`, `Intl.DurationFormat`, `Invoker commands`, `Language detector`, `light-dark()`, `linear() easing`, `Long animation frames`, `Masks`, `moveBefore()`, `Mutually exclusive &lt;details> elements`, `Navigation API`, `navigator.modelContext`, `overlay`, `Page visibility`, `Page visibility state`, `Popover`, `popover="hint"`, `prefers-color-scheme media query`, `prefers-contrast media query`, `prefers-reduced-motion media query`, `Registered custom properties`, `Scheduler API`, `Scroll snap`, `Scroll-driven animations`, `scroll-initial-target`, `scrollbar-color`, `scrollbar-width`, `scrollIntoView()`, `sibling-count() and sibling-index()`, `sin(), cos(), tan(), asin(), acos(), atan(), and atan2() (CSS)`, `Speculation rules`, `Summarizer`, `Temporal`, `text-box`, `text-wrap`, `text-wrap: balance`, `text-wrap: pretty`, `Top-level await`, `transition-behavior`, `Translator`, `View transitions`, `view-transition-class`</summary>
@@ -43,6 +43,7 @@ This curated collection of skills, tools, and AI-ready documentation injects Chr
- **interest-triggered-tooltips**: Show a tooltip or supplemental information when a user hovers over, focuses on, or long-presses an interactive element, without requiring a click.
- **[Anchor positioning](https://webstatus.dev/features/anchor-positioning), [Popover](https://webstatus.dev/features/popover)**
- **persistent-app-tours**: Create persistent onboarding walkthroughs using tethered native overlays that stay open during user interaction.
+ - **resilient-context-menus-and-nested-dropdowns**: 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.
- **[Anchor positioning](https://webstatus.dev/features/anchor-positioning), [Popover](https://webstatus.dev/features/popover), [sibling-count() and sibling-index()](https://webstatus.dev/features/sibling-count), [transition-behavior](https://webstatus.dev/features/transition-behavior)**
- **persistent-toast-notifications**: Create non-intrusive toast and overlay notifications for persistent, stackable messaging and state communication.
- **[blocking="render"](https://webstatus.dev/features/blocking-render), [Cross-document view transitions](https://webstatus.dev/features/cross-document-view-transitions), [&lt;link rel="expect">](https://webstatus.dev/features/link-rel-expect)**
diff --git a/gemini-extension.json b/gemini-extension.json
index 07e4eeb..fcfa0ed 100644
--- a/gemini-extension.json
+++ b/gemini-extension.json
@@ -1,7 +1,7 @@
{
"name": "modern-web-guidance",
"description": "Google Chrome's web development agent skills.",
- "version": "0.0.82",
+ "version": "0.0.83",
"author": {
"name": "Google Chrome"
}
diff --git a/package.json b/package.json
index d6effa7..13625cf 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "modern-web-guidance",
"displayName": "Modern Web Guidance",
"description": "Curated collection of agent skills for modern web development.",
- "version": "0.0.82",
+ "version": "0.0.83",
"publisher": "GoogleChrome",
"engines": {
"vscode": "^1.90.0",
diff --git a/skills/modern-web/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md b/skills/modern-web/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md
new file mode 100644
index 0000000..fcc3704
--- /dev/null
+++ b/skills/modern-web/guides/user-experience/resilient-context-menus-and-nested-dropdowns.md
@@ -0,0 +1,96 @@
+A dropdown menu is a useful pattern for users to access additional functionality while taking up minimal space. This overlay pattern comes with layout complexity, as the menu must remain tethered to a trigger element while adapting to the viewport constraints. Traditionally, this required complex JavaScript libraries (like Popper.js or Floating UI) to calculate positions and handle collisions.
+
+CSS Anchor Positioning provides a declarative, performance-optimized way to handle these relationships entirely in CSS, allowing browsers to manage the positioning and overflow logic.
+
+### 1. Define the Button and Menu Relationship
+
+The first step is to create a button that opens a dropdown menu, using the Popover API.
+
+```html
+<button popovertarget="dropdown-menu">
+ Open
+</button>
+<!-- Use the Popover API (`popover="auto"`) for the overlay to ensure it is placed in the top-layer and handled accessibly by the browser. -->
+<div id="dropdown-menu" popover="auto">
+ <button class="menu-item" type="button">Edit</button>
+</div>
+```
+
+This creates an *implicit* anchor association between the button and the menu, so that the menu can be positioned relative to the button.
+
+### 2. Positioning with `position-area`
+
+Instead of manual `top`/`left` offsets, use `position-area` to place the target on a 3x3 grid relative to the anchor.
+
+```css
+.menu {
+ /*
+ Position the menu below the anchor (block-end),
+ aligned to the start of the anchor and spanning to its end (span-inline-end).
+ */
+ position-area: block-end span-inline-end;
+
+ /* Reset insets to allow the grid to take control */
+ inset: auto;
+}
+```
+
+Prefer logical keywords (`span-inline-end`, `block-start`) over physical ones (`left`, `top`) to support RTL and different writing modes automatically.
+
+**MANDATORY**: Do not mix physical and logical keywords in `position-area`.
+
+### 3. Implement Edge-Resilience (Fallbacks)
+
+To prevent the menu from being cut off at the edge of the screen, define "try tactics" that the browser should attempt if the default position overflows.
+
+```css
+.menu {
+ /*
+ If the menu overflows the bottom, flip it to the top (flip-block).
+ If it overflows the inline edges, flip it horizontally (flip-inline).
+ */
+ position-try-fallbacks: flip-block, flip-inline;
+}
+```
+
+### Fallback strategies
+
+Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.
+
+Popover must conditionally be polyfilled with the `@oddbird/popover-polyfill` polyfill.
+
+```html
+<script type="module">
+ if(!HTMLElement.prototype.hasOwnProperty("popover")){
+ await import("https://unpkg.com/@oddbird/popover-polyfill@latest");
+ }
+</script>
+```
+
+Anchor positioning has limited availability.
+
+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.
+
+For some use cases, you may be able to use the `@oddbird/css-anchor-positioning` polyfill, which adds support for some anchor positioning use cases. 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.
+
+```html
+<!-- MANDATORY: Conditionally install the anchor positioning polyfill -->
+<script type="module">
+ if (!("anchorName" in document.documentElement.style)) {
+ await import("https://unpkg.com/@oddbird/css-anchor-positioning");
+ }
+</script>
+```
+
+```css
+.menu{
+ /* Mandatory: use explicit anchor name */
+ position-anchor: --kebab-anchor;
+ /* Mandatory: use insets rather that position-area for positioning */
+ bottom: auto;
+ right: auto;
+ top: anchor(bottom);
+ left: anchor(left);
+ margin: 0;
+}
+```
\ No newline at end of file