From 657e7111b423ac2d2a1d0c6422b88297f40e2b04 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 23 Mar 2026 12:50:26 +1100 Subject: [PATCH] fix(skin): extract transition properties into CSS custom properties (#1075) Co-authored-by: Claude Opus 4.6 --- .../skills/aria/references/anti-patterns.md | 16 +++++ .claude/skills/aria/references/media.md | 53 ++++++++++----- .../skills/component/references/animation.md | 21 +++++- .../react/src/presets/video/minimal-skin.tsx | 2 +- packages/react/src/presets/video/skin.tsx | 4 +- packages/skins/src/default/css/audio.css | 23 ++++--- .../src/default/css/components/overlay.css | 23 +++---- .../src/default/css/components/popup.css | 3 +- packages/skins/src/default/css/video.css | 68 ++++++++++--------- .../src/default/tailwind/audio.tailwind.ts | 13 +++- .../src/default/tailwind/components/error.ts | 9 +-- .../default/tailwind/components/overlay.ts | 19 +++--- .../src/default/tailwind/components/popup.ts | 4 +- .../src/default/tailwind/video.tailwind.ts | 15 +++- packages/skins/src/minimal/css/audio.css | 27 +++++--- .../src/minimal/css/components/overlay.css | 23 +++---- .../src/minimal/css/components/popup.css | 3 +- packages/skins/src/minimal/css/video.css | 46 ++++++------- .../src/minimal/tailwind/audio.tailwind.ts | 13 +++- .../src/minimal/tailwind/components/error.ts | 9 +-- .../minimal/tailwind/components/overlay.ts | 19 +++--- .../src/minimal/tailwind/components/popup.ts | 4 +- .../src/minimal/tailwind/video.tailwind.ts | 13 +++- 23 files changed, 264 insertions(+), 166 deletions(-) diff --git a/.claude/skills/aria/references/anti-patterns.md b/.claude/skills/aria/references/anti-patterns.md index b7c1d8bf..8c80ec1d 100644 --- a/.claude/skills/aria/references/anti-patterns.md +++ b/.claude/skills/aria/references/anti-patterns.md @@ -215,6 +215,22 @@ Information must not rely on color alone (WCAG 1.4.1). ### No Reduced Motion Support +It's not always required to completely nuke transitions/animations. Sometimes we can instead reduce their duration and delay. People enabling reduced motion often still benefit from some transition - it helps orientation and avoids jarring state changes. + +```css +--transition-duration: 200ms; +--animation-duration: 200ms; + +@media (prefers-reduced-motion: reduce) { + .popup { + --transition-duration: 50ms; + --animation-duration: 50ms; + } +} +``` + +Remove non-essential motion - e.g. parallax, large transforms, bouncing, zooming, auto-playing animations. + ```css .element { animation: bounce 1s infinite; diff --git a/.claude/skills/aria/references/media.md b/.claude/skills/aria/references/media.md index 42766d6a..ef443e17 100644 --- a/.claude/skills/aria/references/media.md +++ b/.claude/skills/aria/references/media.md @@ -19,8 +19,8 @@ Accessibility patterns specific to video and audio players. Covers controls, key The root player element needs proper identification: ```html -
@@ -29,6 +29,7 @@ The root player element needs proper identification: ``` **Attributes:** + - `role="region"` or `role="application"` (if fully keyboard-managed) - `aria-label` includes media type and title - `tabindex="-1"` allows programmatic focus @@ -57,6 +58,7 @@ The root player element needs proper identification: ### Key Scope Configure whether shortcuts work: + - **Document-wide**: Work anywhere on page (YouTube-style) - **Player-scoped**: Only when player has focus @@ -82,6 +84,7 @@ Use toolbar pattern with roving tabindex: ``` **Navigation:** + - `Tab` enters/exits toolbar (single stop) - `←` `→` moves between controls - `Enter`/`Space` activates control @@ -123,6 +126,7 @@ aria-orientation="horizontal" ``` **Key behavior:** + - `←` `→`: Seek by step (5 seconds) - `PageUp` `PageDown`: Seek by large step (10%) - `Home` `End`: Start/end of video @@ -166,8 +170,8 @@ aria-keyshortcuts="c" ### Menu Structure ```html -