-
Notifications
You must be signed in to change notification settings - Fork 707
Add 'prefers-reduced-motion' media feature #586
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
Conversation
Oops. Hold off on this. I need to remove the None keyword. |
Also clarify that 'default' can evaluate to false in a boolean context.
Ready now (fingers crossed) |
@frivoal any comments on this? |
@grorg Sorry for the delay, I have not forgotten. This is in my todo list, gently making its way to the top. Hopefully it'll get there soon. |
I don't particularly like using "default" as a falsey value. It doesn't feel falsey. On the other hand, I can see why "none" doesn't feel super appropriate here. I'm okay with adding a new falsey value for the preference values, tho. What about "no" or "unknown"? Both of these feel much falsier than "default" to me, and also seem like they might be usable in the future for other MQs in a similar situation, where "0" or "none" don't quite mesh. |
|
The current wording - e.g. prefers-reduced-motion - does not allow any future granularity like say numbers, 3d vs 2d, or whatever comes to mind. It is very limiting in future. Is there a particular reason these where not considered?
Edit: @tabatkins the falsey-value issue is also being addressed in the alternative PR I hope. |
Alternative to w3c#586 Having a good wording of the feature also gets around default value evaluating to true instead of false. Ref: w3c#586 (comment)
I agree with the general shape of the proposal, the semantics and the new spec section, but I don't think the naming is great, and also dislike My proposal back from #443 was I don't think the
I'd also be OK with a replacing |
@inoas wrote:
Not true. Future values could be granular tokens, even a combined list, if someone wanted to implement them that way. prefers-reduced-motion: reduce-parallax reduce-scaling; /* reduce-rotation, etc. */
Which alternative PR? Please link. |
@frivoal wrote:
reduced-transparency: none | prefer | force
reduced-motion: none | prefer | force I thought we settled that this syntax was unclear. |
Sure it is true. The variable/setting itself declares that it is only about reduction not about disabling. Because of the choice of words in this PR
If you look at my alternative PR #778 you can see the issue is not appearing anymore. That PR will btw also allow granularity not only in quantity but also quality (e.g. scaling vs parallax vs fading etc) In my alt PR: |
@inoas wrote:
If you're talking about the term "reduced" in the property name, I think we're mincing semantics. Disabling motion is a reduction of motion, albeit a complete one.
This argument is a straw man fallacy because the PR does not include or suggest a |
A complete reduction of non-interaction triggered animation has to be allowed in the settings. Given the scenario where items animate into a scene, users prone to motions sickness, vertigo, migraines, or distraction need this turned off yet usable. Interaction triggered animation needs to be minimized, some stopped depending on what it is. Small animations such as color fades or animated icons on buttons or links likely won't cause a trigger point, but other animations non-essential to the control function may cause problems for users. Reducing motion is good. But stopping/preventing/pausing animation and making the content still readable, actionable, and usable is needed. Additionally, best practices should be worded in a PE approach of no-motion, reduced-motion, full-motion structuring of CSS. |
@nattarnoff wrote:
Currently, no platforms implement that in native UI or web UI. At such a time that any do, it would be appropriate to standardize in Web API.
Herein lies the problem. As CSS and JavaScript-based animations are implemented as primitives, there is no good way for a browser to know which animations may be vestibular triggers. Stopping all motion entirely may be technically possible, but would be a heavy-handed approach that would likely result in a much worse user experience, because it would break the animations that convey meaning in the interface. Apple has chosen to expose a user preference on its native platforms which allows authors to adopt and determine which animations are appropriate to reduce. This approach takes evangelism, but seems to be working well. |
Why couldn't the Web API take the lead instead of waiting for native or web UI? If we establish the ability and best practice, are we not evangelizing that they should catch up and implement it?
Sadly after thinking through this a little more, I see this problem. Perhaps it is out of scope for this PR, but it is something that should be investigated. On the WCAG side of the fence, there is w3c/wcag21#18 which is about defining accessible animation from interaction. SC 2.2.2 Pause, Stop, Hide covers animation that isn't by direct user interaction. |
@nattarnoff wrote:
I think you'll find any proposal to disable all animations on the Web very controversial and difficult to implement well. Also, advocacy through specification is usually frowned upon. Perhaps try an incubation approach in WICG or as a separate CSSWG issue instead? I agree that it's out-of-scope for this PR. |
This discussion is kind of spreading over a bunch of places. I made a comment in #442 (comment) to try and summaries all that's been said in terms of naming options, and try to find a winner. |
mediaqueries/Overview.bs
Outdated
@@ -491,7 +491,7 @@ Evaluating Media Features in a Boolean Context</h4> | |||
If the feature would be true for any value | |||
<em>other than</em> the number ''0'', | |||
a <<dimension>> with the value ''0'', | |||
or the keyword ''none'', | |||
or the keywords ''none'' and ''default'', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change default
to no-preference
per discussion
mediaqueries/Overview.bs
Outdated
|
||
<pre class='descdef mq'> | ||
Name: prefers-reduced-motion | ||
Value: default | reduce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
mediaqueries/Overview.bs
Outdated
uses. | ||
|
||
<dl dfn-type=value dfn-for="@media/prefers-reduced-motion"> | ||
<dt><dfn>default</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
||
</dl> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a editorial note to the discussion in #442?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not do that, at least not without a summary of what you want people to go look for in that giant rambling of ours.
Updated to use "no-preference" over "default". |
Available here. https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion |
Added a new section for user preferences, with the assumption we'll get more of them.
Added the prefers-reduced-motion feature, discussed in #442
WebKit plans to implement this asap.