Keep your coding agent up to date with the latest web best practices
Release v0.0.56
github-actions[bot]ba390535d4c9
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 79d0f02..fdba8d8 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.55"+ "version": "0.0.56"}]}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 62b3517..5931ea3 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.55",+ "version": "0.0.56","author": {"name": "Google Chrome"}diff --git a/README.md b/README.mdindex c2a3e67..2e2fe72 100644--- a/README.md+++ b/README.md@@ -2,11 +2,13 @@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.55`+#### Skill Coverage in `v0.0.56`<details>-<summary><strong>69 web features with implementation guidance from Chrome's experts</strong>: `:autofill`, `:has()`, `:not()`, `:user-valid and :user-invalid`, `@starting-style`, `<details>`, `<dialog closedby>`, `<dialog>`, `<link rel="expect">`, `<link rel="preload">`, `AbortController and AbortSignal`, `Active view transition`, `Anchor positioning`, `blocking="render"`, `calc-size()`, `color-scheme`, `content-visibility`, `Cross-document view transitions`, `Customizable <select>`, `Email, telephone, and URL <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`, `Intl.DurationFormat`, `Invoker commands`, `light-dark()`, `linear() easing`, `Long animation frames`, `Masks`, `moveBefore()`, `Mutually exclusive <details> elements`, `Navigation API`, `navigator.modelContext`, `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`, `Temporal`, `text-box`, `text-wrap`, `text-wrap: balance`, `text-wrap: pretty`, `Top-level await`, `transition-behavior`, `View transitions`</summary>+<summary><strong>71 web features with implementation guidance from Chrome's experts</strong>: `::backdrop`, `:autofill`, `:has()`, `:not()`, `:user-valid and :user-invalid`, `@starting-style`, `<details>`, `<dialog closedby>`, `<dialog>`, `<link rel="expect">`, `<link rel="preload">`, `AbortController and AbortSignal`, `Active view transition`, `Anchor positioning`, `blocking="render"`, `calc-size()`, `color-scheme`, `content-visibility`, `Cross-document view transitions`, `Customizable <select>`, `Email, telephone, and URL <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`, `Intl.DurationFormat`, `Invoker commands`, `light-dark()`, `linear() easing`, `Long animation frames`, `Masks`, `moveBefore()`, `Mutually exclusive <details> elements`, `Navigation API`, `navigator.modelContext`, `overlay`, `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`, `Temporal`, `text-box`, `text-wrap`, `text-wrap: balance`, `text-wrap: pretty`, `Top-level await`, `transition-behavior`, `View transitions`</summary>+- **[::backdrop](https://webstatus.dev/features/backdrop), [<dialog>](https://webstatus.dev/features/dialog), [overlay](https://webstatus.dev/features/overlay), [Popover](https://webstatus.dev/features/popover), [@starting-style](https://webstatus.dev/features/starting-style), [transition-behavior](https://webstatus.dev/features/transition-behavior)**+ - **animate-to-from-top-layer**: Animate elements such as dialogs, popovers, and tooltips as they're entering/exiting the top layer.- **[:autofill](https://webstatus.dev/features/autofill)**- **autofill-address-form**: Build an address form with correct autocomplete attributes and autofill support.- **autofill-highlight-inputs**: Use CSS to highlight form fields that have been autofilled by the browser and not edited by the user.diff --git a/gemini-extension.json b/gemini-extension.jsonindex e4c819a..7e8420b 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.55",+ "version": "0.0.56","author": {"name": "Google Chrome"}diff --git a/package.json b/package.jsonindex b6bf4b7..ccb215d 100644--- a/package.json+++ b/package.json@@ -3,7 +3,7 @@"displayName": "Modern Web Guidance","private": true,"description": "Curated collection of agent skills for modern web development.",- "version": "0.0.55",+ "version": "0.0.56","publisher": "GoogleChrome","engines": {"vscode": "^1.90.0",diff --git a/skills/modern-web/guides/user-experience/animate-to-from-top-layer.md b/skills/modern-web/guides/user-experience/animate-to-from-top-layer.mdnew file mode 100644index 0000000..33c75c2--- /dev/null+++ b/skills/modern-web/guides/user-experience/animate-to-from-top-layer.md@@ -0,0 +1,135 @@+Elements that render in the "top layer" (like `<dialog>`, elements with the `popover` attribute, or tooltips) have historically been difficult to animate because they toggle between `display: none` and a visible state. Modern CSS provides `@starting-style`, `transition-behavior: allow-discrete`, and the `overlay` property to enable smooth entry and exit transitions for these elements. Note that native CSS nesting is used in the examples below.++## Implementation++### 1. Enable Discrete Transitions++To animate the `display` property, you must set `transition-behavior: allow-discrete`. This allows the element to remain visible during its exit transition. If using transition shorthands, be sure to place the `transition-behavior: allow-discrete` afterwards to prevent the shorthand from negating it.++### 2. The `overlay` Property++When an element moves in or out of the top layer, it must transition the `overlay` property. This ensures the element stays in the top layer for the duration of the animation, preventing it from being clipped by other elements or the viewport prematurely.++### 3. Entry Animations with `@starting-style`++Use the `@starting-style` at-rule to define the styles an element should transition *from* when it is first rendered or its `display` changes from `none`.++### 4. Animating the Backdrop++The `::backdrop` pseudo-element can be animated similarly by applying transitions to its own properties.++## Example++```css+/* 1. Define the visible (open) state */+dialog[open],+[popover]:popover-open {+ opacity: 1;+ transform: scale(1);++ /* 2. Define the starting state for entry (must come after open state) */+ @starting-style {+ opacity: 0;+ transform: scale(0.9);+ }+}++/* 3. Define the base (closed/exit) state and transitions */+dialog,+[popover] {+ opacity: 0;+ transform: scale(0.9);++ /* MANDATORY: transition display and overlay for top-layer elements */+ transition-property: opacity, transform, display, overlay;+ transition-duration: 0.3s;+ transition-timing-function: ease-out;+ /* Applies to discrete properties like display and overlay */+ transition-behavior: allow-discrete; /* Note: be sure to write this after the shorthand */+}++/* 4. Animate the backdrop */+dialog::backdrop,+[popover]::backdrop {+ background-color: rgba(0, 0, 0, 0);+ /* The transition shorthand can also be used with allow-discrete */+ transition:+ display 0.3s allow-discrete,+ overlay 0.3s allow-discrete,+ background-color 0.3s ease-out;+}++dialog[open]::backdrop,+[popover]:popover-open::backdrop {+ background-color: rgba(0, 0, 0, 0.5);++ @starting-style {+ background-color: rgba(0, 0, 0, 0);+ }+}++/* 5. Respect user preference for reduced motion */+@media (prefers-reduced-motion: reduce) {+ dialog,+ [popover] {+ /* Disable movement and shorten duration for a simple fade */+ transform: none;+ transition-duration: 0.1s;+ }++ @starting-style {+ dialog[open],+ [popover]:popover-open {+ transform: none;+ }+ }+}+```++## Constraints & Accessibility++- **MANDATORY**: Include `overlay` in your `transition` list for any element moving into or out of the top layer.+- **MANDATORY**: Use `allow-discrete` for the `display` property transition.+- **MANDATORY**: Respect user preferences for reduced motion using `prefers-reduced-motion` by simplifying transitions (e.g., removing transforms and shortening duration).+- **DO**: Place the `@starting-style` block inside or after the "open" state selector to ensure proper cascading.+- **DO NOT**: Use `@starting-style` for exit animations; exit animations are defined by the transition to the base (closed) state.++## Fallback strategies++#### Top-layer animation features++Baseline status for @starting-style: Newly available. It's been Baseline since 2024-08-06.+Baseline status for transition-behavior: Newly available. It's been Baseline since 2024-08-06.+overlay has limited availability.++For browsers that do not support these features, top-layer elements will appear and disappear instantly. To provide animations in older browsers, you must use JavaScript to coordinate classes and wait for `transitionend` events or use the Web Animations API.++```javascript+// Feature detection for top-layer animations+const supportsTopLayerAnimation =+ window.CSS &&+ CSS.supports('transition-behavior', 'allow-discrete') &&+ CSS.supports('overlay', 'auto');++if (!supportsTopLayerAnimation) {+ // Manual JS fallback for entry/exit animations:+ // 1. Add an `.is-opening` class for entry.+ // 2. On close, add an `.is-closing` class, wait for the `transitionend` event, then call .close() or hide the popover.+}+```++#### popover++Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.++If the browser does not support Popover, use the `@oddbird/popover-polyfill`:++```html+<script type="module">+ if (!HTMLElement.prototype.hasOwnProperty('popover')) {+ await import('https://unpkg.com/@oddbird/popover-polyfill');+ }+</script>+```++Alternatively, for legacy support without a polyfill, use `position: fixed` and manually calculate coordinates via JavaScript `getBoundingClientRect()`.