happo.io icon indicating copy to clipboard operation
happo.io copied to clipboard

Feature request: add a way to configure targets to use the prefers reduced motion option

Open lencioni opened this issue 6 years ago • 1 comments

Happo is allergic to animations. Some animations, like from animated GIFs, are hard to disable using CSS. I think it would be nice to add an option to targets (or maybe just make it the default) to allow them to be run with the prefers reduced motion option enabled. This would give consumers an easy way to fix this class of spurious diffs while also making their product more accessible.

More info: https://developers.google.com/web/updates/2019/03/prefers-reduced-motion

lencioni avatar Sep 18 '19 20:09 lencioni

This has been added to Chrome now!

lencioni avatar Nov 03 '19 09:11 lencioni

upvote for this! it would be a more semantic alternative to data-happo-hide in many contexts

tedpennings avatar Jan 24 '23 22:01 tedpennings

This is actually already possible if you set prefersReducedMotion: true for a target in .happo.js. E.g.

module.exports = {
  targets: { 
    chrome: new RemoteBrowserTarget('chrome', { viewport: '800x600', prefersReducedMotion: true }),
  },
};

IIRC, this works in Happo targets for Firefox, Safari, Chrome and Edge but not iOS Safari.

I'm adding documentation for this right away.

trotzig avatar Jan 25 '23 07:01 trotzig

Docs are now updated: https://docs.happo.io/docs/configuration#target-prefersreducedmotion

trotzig avatar Jan 25 '23 07:01 trotzig