-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] opt-out and/or configure padding transition/animation duration #31
Comments
Hi @andyford! That makes total sense. The CSS transition was based on the Backgrounds addon behavior, although I noticed it has a check for reduced motion preference now. Do you know if adding that check would solve the visual regression testing issue? In other words, does the test framework load pages with reduced motion preference? It wouldn't get rid of padding transitions on each story change though, so opting out or completely removing the feature are still considered 🙂 |
Sorry I haven't been able to test this but I can't imagine relying on a user setting like But to answer the question But as an accessibity consideration, it would be super nice to do the |
That code has to run in a browser context, so I think it's safe to assume Even if the test framework load pages with reduced motion preference, you would still encounter this problem, as the addon currently doesn't disable the transition in that case. But I agree we may not rely on that preference being set, especially if there's no way to configure it. So, we should handle reduced motion for accessibility reasons, but it may not solve visual regression testing issues, and won't stop transitions from replaying when switching between stories. (relates to storybookjs/storybook#17122) I'll probably submit a couple separate PRs for these. Until then, the workaround is to turn off transitions in the preview 😉 |
I'm wondering if it could be possible to opt-out of (or configure) the padding CSS animation duration.
Subjectively, I personally find it a little distracting that the padding animates on each new page view.
Objectively, I've encountered an issue with the visual regression testing approach outlined here https://storybook.js.org/blog/interaction-testing-with-storybook/#extend-and-customize-using-the-test-hook-api
... my screenshots were inconsistent and it turned out that it was caused by the paddings addon.
For now, I've added
.sb-show-main { transition: none; }
which is fine but the Storybook team seems to be moving more toward this visual regression testing approach (rather than Storyshots), so this issue may come up more often.The text was updated successfully, but these errors were encountered: