Skip to content

Accessibility: add reduced-motion & forced-colors defaults, fallbacks, docs and demo#81

Draft
developit wants to merge 4 commits into
mainfrom
codex/enhance-accessibility-for-animations-and-colors
Draft

Accessibility: add reduced-motion & forced-colors defaults, fallbacks, docs and demo#81
developit wants to merge 4 commits into
mainfrom
codex/enhance-accessibility-for-animations-and-colors

Conversation

@developit
Copy link
Copy Markdown
Owner

Motivation

  • Ensure PUI honors OS/browser accessibility preferences by disabling or reducing non-essential motion and preserving critical affordances in high-contrast environments.
  • Provide predictable, CSS-first low-motion fallbacks for the most common animated primitives so overlays and loaders remain usable without JS feature flags.
  • Document the platform media-query behavior so theme authors and app integrators follow the same declarative approach.
  • Add a visual demo route so maintainers can quickly validate reduced-motion and forced-colors behavior during development.

Description

  • Added accessibility media-query baselines to src/base.css with @media (prefers-reduced-motion: reduce) to suppress animations/transitions and @media (forced-colors: active) to expose system focus/border semantics.
  • Added targeted low-motion fallbacks in component styles for animated primitives: src/components/dialog/style.css, src/components/drawer/style.css, src/components/sheet/style.css, src/components/skeleton/style.css, src/components/spinner/style.css, and src/lib/toast.css (reduced-motion + forced-colors adjustments).
  • Added a demo route demo/src/routes/a11y-modes.tsx, wired it into the router (demo/src/main.tsx) and navigation (demo/src/nav.tsx), and included demo-specific styles in demo/src/style.css to surface sanity checks.
  • Updated documentation with an “Accessibility Media Queries” section and high-contrast guidance in docs/pages/base-styles.md and docs/pages/theming.md describing recommended usage and sample CSS.

Testing

  • Ran pnpm build at the repo root and the build completed successfully.
  • Ran pnpm build in the demo/ directory and the demo built successfully and produced the demo assets.
  • Started the demo and captured an automated screenshot of /a11y-modes using Playwright to validate visuals (artifact produced).
  • Ran pnpm lint which failed due to pre-existing TypeScript issues unrelated to these accessibility CSS and demo changes (no failing tests attributable to this PR).

Codex Task

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 23, 2026

Deploy Preview for pui-demo ready!

Name Link
🔨 Latest commit 40b5f87
🔍 Latest deploy log https://app.netlify.com/projects/pui-demo/deploys/699d9d737f913b00084d069b
😎 Deploy Preview https://deploy-preview-81--pui-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 23, 2026

Size Change: +137 B (+0.99%)

Total Size: 14 kB

Filename Size Change
dist/index.css 8.53 kB +137 B (+1.63%)
ℹ️ View Unchanged
Filename Size
dist/index.js 5.43 kB

compressed-size-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant