-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Warn when view transitions run on a prefer-reduced-motion device #10222
Conversation
🦋 Changeset detectedLatest commit: 0e8e09b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hmm ignoring in dev might be nice, but I assume there’s at least one dev who actually does want to prefer reduce motion for their own sake. Could it be a config option ? |
Ah @OliverSpeir , I'm afraid, I didn't make myself clear: If someone has set up prefer-reduced-motion, we should definitely respect that. But I suspect that many developers only come across users who have set up their system this way in PROD. I therefore believe that the new warning message could also be useful in PROD. |
Might need a different text then: "This page was created with view transitions. Because your device ...." or similar. I'm usually the worst candidate to get English text right :) |
A lot of people will dislike logging happening in their frontend application. I think in dev mode it is ok, but wouldn't want it in prod. |
Then fine with me as is. |
Co-authored-by: Emanuele Stoppa <[email protected]>
Changes
In DEV mode, warn in the browser console when view transitions are used on a prefer-reduced-motion device.
A user at discord complained that view transitions wouldn't work at all, and @FredKSchott suggested that this could be the reason. Always fun to use an argument from authority!
Question: I would even like to remove the restriction that the warning is only shown in DEV mode as it is really hard to find. What do the approvers think?
Edit: (The warning is only shown with initial page loads, not on every view transition)
Testing
Manually tested on Windows with Chrome
Docs
Basically the warning message copies https://docs.astro.build/en/guides/view-transitions/#prefers-reduced-motion. So docs is more than up-to-date.