Skip to content

Commit dacc5f2

Browse files
style: prefer reduced motion (#717)
* style: prefer reduced motion * style: prefer reduced motion * style: update motion preferences to enable transitions only when `prefers-reduced-motion: no-preference` * style: unify transition properties across components using CSS variables
1 parent 9d0b074 commit dacc5f2

39 files changed

Lines changed: 213 additions & 113 deletions

File tree

apps/www/src/content/docs/components/accordion/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ The accordion content can contain any React elements, allowing for rich layouts
9090
- Trigger elements use `aria-expanded` to indicate open/closed state
9191
- Supports keyboard navigation with Enter and Space to toggle items
9292
- Content panels use `aria-controls` and `aria-labelledby` for association
93+
- Respects motion preferences: icon rotation and panel expand/collapse motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/alert-dialog/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@ You can nest alert dialogs for multi-step confirmation flows. When a nested aler
121121
- Uses `aria-label` or `aria-labelledby` to identify the dialog
122122
- Uses `aria-describedby` to provide additional context
123123
- Focus is trapped within the alert dialog while open
124+
- Respects motion preferences: alert dialog panel motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/button/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ The button component accepts optional leading and/or trailing icons.
7575
- Supports keyboard activation with Enter and Space keys
7676
- Disabled state is communicated via `aria-disabled` attribute
7777
- Loading state prevents interaction and announces status to screen readers
78+
- Respects motion preferences: button loader rotation is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/collapsible/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ The collapsible can be disabled to prevent user interaction.
7272
- The Trigger uses `aria-expanded` to indicate the open/closed state of the panel.
7373
- Supports keyboard interaction with Enter and Space to toggle the panel.
7474
- The Panel is automatically associated with the Trigger via `aria-controls`.
75+
- Respects motion preferences: panel expand/collapse motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/dialog/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,4 @@ You can nest dialogs within one another. When a nested dialog opens, the parent
123123
- Dialog has `role="dialog"` and `aria-modal="true"`
124124
- Uses `aria-label` or `aria-labelledby` to identify the dialog
125125
- Uses `aria-describedby` to provide additional context
126+
- Respects motion preferences: dialog panel motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/drawer/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ The Drawer can slide in from different sides of the screen. Swipe-to-dismiss is
8080
- Focus is trapped within the drawer and restored on close
8181
- Supports dismissal with Escape key and swipe gestures
8282
- Title is announced via `aria-labelledby`
83+
- Respects motion preferences: drawer slide motion is enabled only when `prefers-reduced-motion: no-preference`
8384

apps/www/src/content/docs/components/link/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ The Link component follows accessibility best practices:
6565
- External links have aria-labels indicating they open in new tabs
6666
- Download links include appropriate aria-labels
6767
- Maintains color contrast ratios for all variants
68+
- Hover feedback uses an opacity transition

apps/www/src/content/docs/components/popover/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ Customize how the popover aligns with its trigger.
6161
- Trigger uses `aria-haspopup` and `aria-expanded` attributes
6262
- Focus is managed when opening and closing the popover
6363
- Supports dismissal with Escape key
64+
- Respects motion preferences: popover entry motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/preview-card/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ Control the position of the preview card relative to its trigger.
7676
- Closes when the pointer leaves the trigger or content area
7777
- Content is accessible to screen readers when open
7878
- Trigger renders as a semantic `<a>` element
79+
- Respects motion preferences: preview card open/close motion is enabled only when `prefers-reduced-motion: no-preference`

apps/www/src/content/docs/components/sidebar/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Set `hideCollapsedItemTooltip` to disable tooltips on navigation items when the
103103

104104
The Sidebar implements the following accessibility features:
105105

106-
- **Reduced motion**Respects the user's motion preferences. When the system "Reduce motion" setting is enabled, collapse/expand and hover transitions are disabled so the sidebar updates without animation.
106+
- **Reduced motion**Sidebar collapse/expand motion is enabled only when `prefers-reduced-motion: no-preference`.
107107

108108
- Proper ARIA roles and attributes
109109

0 commit comments

Comments
 (0)