web-animation-view-transitions-82d500 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited web-animation-view-transitions-82d500 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Quick Guide: Use the View Transitions API for native page/state transitions.document.startViewTransition()for same-document,@view-transition { navigation: auto }for cross-document MPA. Always feature-detect before use and respectprefers-reduced-motion. Use the options formstartViewTransition({ update, types })when you need typed transitions.
<critical_requirements>
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering, import type, named constants)(You MUST feature-detect before using startViewTransition - it is NOT available in all browsers)
(You MUST respect prefers-reduced-motion by providing reduced or disabled animations)
(You MUST ensure view-transition-name values are unique - duplicate names break transitions)
(You MUST clean up dynamically assigned view-transition-name values after transitions complete)
(You MUST use named constants for all animation timing values - NO magic numbers)
</critical_requirements>
Auto-detection: View Transitions API, startViewTransition, view-transition-name, @view-transition, ::view-transition, pageswap, pagereveal, ViewTransition, view-transition-class, match-element, active-view-transition-type
When to use:
Key patterns covered:
When NOT to use:
Detailed Resources:
<philosophy>
The View Transitions API provides a native browser mechanism for creating animated transitions between DOM states or pages. It captures "before" and "after" snapshots, overlays them as pseudo-elements, and animates between them.
Core principles:
</philosophy>
<patterns>
Always check for API support before using View Transitions. See examples/core.md Pattern 1 for full utility.
const SUPPORTS_VIEW_TRANSITIONS =
typeof document !== "undefined" && "startViewTransition" in document;
function updateWithTransition(updateFn: () => void | Promise<void>): void {
if (!SUPPORTS_VIEW_TRANSITIONS) {
updateFn();
return;
}
document.startViewTransition(() => updateFn());
}Why good: Prevents runtime errors in unsupported browsers, provides seamless fallback
Animate DOM state changes within a single page. See examples/core.md Patterns 2-5 for state transitions, async loading, promise handling, and skip logic.
// startViewTransition accepts a callback or an options object
const transition = document.startViewTransition(async () => {
await updateFn();
});
// Options form - set types for CSS targeting
const transition = document.startViewTransition({
update: () => updateDOM(),
types: ["slide-forward"],
});
await transition.finished;ViewTransition object provides three promises:
| Promise | Resolves when |
|---|---|
transition.ready | Pseudo-element tree created |
transition.updateCallbackDone | DOM update callback completed |
transition.finished | Animation complete |
Enable transitions between separate pages without JavaScript. Both pages must opt in.
/* Include on BOTH source and destination pages */
@view-transition {
navigation: auto;
}Why good: No JavaScript required, works for traverse/push/replace navigations
Obsolete syntax: <meta name="view-transition" content="same-origin"> - use the CSS at-rule instead.
Create hero animations by giving matching elements the same view-transition-name. See examples/shared-elements.md for full product list-to-detail, multi-element, and MPA examples.
:root {
--hero-duration: 300ms;
--hero-easing: cubic-bezier(0.4, 0, 0.2, 1);
}
/* Same name on both pages/states creates shared element animation */
.product-thumbnail {
view-transition-name: product-hero;
}
.product-image {
view-transition-name: product-hero;
}
::view-transition-group(product-hero) {
animation-duration: var(--hero-duration);
animation-timing-function: var(--hero-easing);
}Key rules: Names must be unique across the document. Clean up dynamically assigned names after transition.finished.
Override default cross-fade with custom animations via pseudo-elements. See examples/core.md Pattern 6 for full examples.
:root {
--transition-duration: 300ms;
--transition-easing: ease-in-out;
}
::view-transition-old(root) {
animation: slide-out-left var(--transition-duration) var(--transition-easing);
}
::view-transition-new(root) {
animation: slide-in-right var(--transition-duration) var(--transition-easing);
}Why good: CSS custom properties for timing constants, GPU-accelerated transforms
Use different animations for forward vs backward navigation. Use the types parameter or ViewTransition.types set.
html:active-view-transition-type(forwards) {
&::view-transition-old(content) {
animation-name: slide-out-left;
}
&::view-transition-new(content) {
animation-name: slide-in-right;
}
}
html:active-view-transition-type(backwards) {
&::view-transition-old(content) {
animation-name: slide-out-right;
}
&::view-transition-new(content) {
animation-name: slide-in-left;
}
}// Preferred: set types via options parameter
document.startViewTransition({
update: () => navigateForward(),
types: ["forwards"],
});
// Alternative: mutate types set on existing transition
const transition = document.startViewTransition(updateFn);
transition.types.add("forwards");See examples/spa.md for form step and tab panel examples.
Always respect user preferences for reduced motion.
@media (prefers-reduced-motion: reduce) {
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
animation-duration: 0.01ms !important;
}
}const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
function shouldEnableTransitions(): boolean {
if (window.matchMedia(REDUCED_MOTION_QUERY).matches) return false;
return "startViewTransition" in document;
}See examples/spa.md for a full accessible transition wrapper with preference change monitoring.
Advanced custom animation using Web Animations API. Must await transition.ready before animating pseudo-elements.
const REVEAL_DURATION_MS = 400;
const REVEAL_EASING = "ease-in-out";
const transition = document.startViewTransition(updateFn);
await transition.ready;
document.documentElement.animate(
{
clipPath: [`circle(0 at ${x}px ${y}px)`, `circle(${r}px at ${x}px ${y}px)`],
},
{
duration: REVEAL_DURATION_MS,
easing: REVEAL_EASING,
pseudoElement: "::view-transition-new(root)",
},
);See examples/spa.md for a complete theme-switcher circular reveal implementation.
</patterns>
<red_flags>
High Priority Issues:
startViewTransition() without checking support crashes in older browsersMedium Priority Issues:
<meta name="view-transition"> is deprecated; use @view-transition CSSmatch-elementGotchas & Edge Cases:
<head> or use blocking="render"auto, inherit, none, unset) are CSS keywords, not valid custom identifiers</red_flags>
<critical_reminders>
All code must follow project conventions in CLAUDE.md
(You MUST feature-detect before using startViewTransition - it is NOT available in all browsers)
(You MUST respect prefers-reduced-motion by providing reduced or disabled animations)
(You MUST ensure view-transition-name values are unique - duplicate names break transitions)
(You MUST clean up dynamically assigned view-transition-name values after transitions complete)
(You MUST use named constants for all animation timing values - NO magic numbers)
Failure to follow these rules will break transitions in unsupported browsers and create inaccessible experiences.
</critical_reminders>
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.