Keep your coding agent up to date with the latest web best practices
Release v0.0.57
github-actions[bot]81d4a28129b9
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex fdba8d8..cc0d721 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.56"+ "version": "0.0.57"}]}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 5931ea3..3af8203 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.56",+ "version": "0.0.57","author": {"name": "Google Chrome"}diff --git a/README.md b/README.mdindex 2e2fe72..ed32853 100644--- a/README.md+++ b/README.md@@ -2,10 +2,10 @@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.56`+#### Skill Coverage in `v0.0.57`<details>-<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>+<summary><strong>72 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`, `view-transition-class`</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.@@ -155,6 +155,8 @@ This curated collection of skills, tools, and AI-ready documentation injects Chr- **prevent-text-wrapping**: Ensure the browser does not insert line breaks into text and will allow text to overflow its container.- **[Top-level await](https://webstatus.dev/features/top-level-await)**- **conditional-async-dependencies**: 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.+- **[view-transition-class](https://webstatus.dev/features/view-transition-class), [View transitions](https://webstatus.dev/features/view-transitions)**+ - **group-element-transitions**: 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.</details>diff --git a/gemini-extension.json b/gemini-extension.jsonindex 7e8420b..4620853 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.56",+ "version": "0.0.57","author": {"name": "Google Chrome"}diff --git a/package.json b/package.jsonindex ccb215d..d8ae6a4 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.56",+ "version": "0.0.57","publisher": "GoogleChrome","engines": {"vscode": "^1.90.0",diff --git a/skills/modern-web/guides/user-experience/group-element-transitions.md b/skills/modern-web/guides/user-experience/group-element-transitions.mdnew file mode 100644index 0000000..9e1daa4--- /dev/null+++ b/skills/modern-web/guides/user-experience/group-element-transitions.md@@ -0,0 +1,123 @@+As items are added or removed from a list, or rearranged, transitions can help users maintain context. View transitions provide a way to transition between two states of an element by giving the element a unique `view-transition-name`. When multiple elements on a page share the same transition behavior, `view-transition-class` allows you to define that logic once in CSS rather than repeating it for every unique `view-transition-name`. This keeps your stylesheets maintainable while ensuring consistent animations across a group of elements.++### Implementation steps++1. **Assign unique names and a shared class**++Each element that needs to be tracked individually during a transition must have a unique `view-transition-name`.++```html+<!-- Mandatory: Each element must have a unique view-transition-name -->+<li style="view-transition-name: item-1" class="item">Item 1</li>+<li style="view-transition-name: item-2" class="item">Item 2</li>+```++To apply shared styles, also assign a `view-transition-class`.++```css+.item {+ view-transition-class: list-item;+}+```++2. **Define the shared transition logic**++Use the `::view-transition-group()` pseudo-element with the class selector to apply styles to all members of that group.++```css+/* Targets any view transition group that has the 'list-item' class */+::view-transition-group(.list-item) {+ animation-duration: 0.5s;+ animation-timing-function: ease-in-out;+}++/* Handle accessibility by respecting motion preferences */+@media (prefers-reduced-motion: reduce) {+ /* Disable all group transitions, including the default `root` group. */+ ::view-transition-group(*),+ ::view-transition-old(*),+ ::view-transition-new(*) {+ animation: none !important;+ }+}+```++3. **Optional: Define entry and exit animations**++Use the `:only-child` selector to add specific transitions to the elements that are added or removed. `::view-transition-new()` and `::view-transition-old()` pseudo-elements are children of a `::view-transition-image-pair()` pseudo-element, so we can determine it is an added or removed element if it is the only child.++```css+/* A `::view-transition-new()` element is the only child if it wasn't present before the view transition, so it is an added element. */+::view-transition-new(.list-item):only-child {+ animation-name: slide-in;+ /* Specify an animation duration if you want something different than the UA default of 0.5s */+ animation-duration: 1s;+}+/* A `::view-transition-old()` element is the only child if it isn't present after the view transition, so it is a removed element. */+::view-transition-old(.list-item):only-child {+ animation-name: slide-out;+ /* Specify an animation duration if you want something different than the UA default of 0.5s */+ animation-duration: 1s;+}++@keyframes slide-in {+ from {+ translate: -100vw 0;+ }+}+@keyframes slide-out {+ to {+ translate: -100vw 0;+ }+}+```++4. **Trigger the transition**++Wrap the DOM update in `document.startViewTransition()`. The browser will capture the old state, perform the update, and then animate to the new state.++```javascript+function updateList(newData) {+ document.startViewTransition(() => {+ // All DOM changes inside this callback will be transitioned+ render(newData);+ });+}+```++5. **Maintain interactivity of non-transitioned elements**++View transitions work by overlaying snapshots of the DOM elements, and then transitioning the snapshots. This means that during the transition, elements are not interactive. If there are interactive elements that are not transitioned, you can make them interactive by disabling touch events on the view transitions.++```css+::view-transition {+ /* Non-transitioned elements below the view transitions remain interactive */+ pointer-events: none;+}+```++In addition, by default, the `:root` element has a view transition named `root`, which enables default full-page transitions. If there are no changes to the root element, this will be a transition between two identical snapshots, which are not interactive. Because we are only transitioning specific elements, and not the entire screen, we can disable the `root` transition.++```css+:root {+ /* Disable the root transition because we are only transitioning specific elements. */+ view-transition-name: none;+}+```++### Fallback strategies++Baseline status for view-transition-class: Newly available. It's been Baseline since 2025-10-14.++View Transitions are a progressive enhancement. If the browser does not support `document.startViewTransition`, the DOM update should still occur immediately, providing a functional but non-animated experience.++```javascript+if (document.startViewTransition) {+ document.startViewTransition(() => updateDOM());+} else {+ // Fallback: Perform the update without animation+ updateDOM();+}+```++For CSS, browsers that do not recognize `view-transition-class` or the `::view-transition-group()` class selector will simply ignore those rules, and no animation will be applied.