Respect prefers-reduced-motion
Turn off or shorten animations for users who ask their system for less motion.
Loading snippets…
11 snippets
Turn off or shorten animations for users who ask their system for less motion.
Show a clear focus outline for keyboard users without drawing it on mouse clicks.
Use the native dialog element for a modal with built-in focus trapping, Escape to close and a backdrop.
A keyboard-accessible FAQ accordion with no JavaScript, including an exclusive group using the name attribute.
A base button with hover, active, disabled and focus styles that meets minimum target size.
Use caption, thead, th scope and a scroll wrapper so screen readers and small screens handle tables well.
Hide content visually while keeping it available to assistive technology.
Switch themes by redefining variables under prefers-color-scheme, with a manual override attribute.
Use the async Clipboard API with a legacy fallback and report success or failure to the user.
Let keyboard users jump past repeated navigation straight to the main content.
Associate labels, help text and validation errors with an input so screen readers announce them.