-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
[RFC] More consistent definitions and better accessibility #1371
Comments
Hey @brc-dd , thanks for the proposal they make sense, but first a few explanations:
|
@eltonmesquita Yeah, I agree on that timing stuff. So can we at least fix the numbers? I mean, like have something that's off-screen on even 4k resolutions and use them throughout the project (preferably via CSS variables). That visibility thing was probably introduced because omitting it would make the element visible, and using Regarding the fourth point, I think you misunderstood that. I wasn't saying to use And the fifth, there are a bunch of other animation classes where similar things are present. And yeah, happy to contribute. I had actually fixed them in one of my Tailwind plugins. It won't take too long to backport the fixes. |
No special accommodation for pixels in 4k is needed (everything is specified in 'logical pixels' - not device pixels). So everything happening with device pixels is just doubled compared to a 1920x1080 screen. It makes no difference to definitions of animations and distances. Just in the same way as you don't have to do something different from an iPhone with 2x pixels to one with 3x pixels. I came to this post because of my concern about animations with translateX tranforms with magic numbers like 2000px. While it's fair to say that using 100vw instead of 2000px would make the animations slower on a smaller screen the problem I'm encountering is that since most of the animation now occurs offscreen you lose the nuances of the 'easing'. And a one second duration is meaningless if 750ms of the animation occurs off screen! If something is 'bouncing' or 'easing' over a distance of 2000px then the bouncing or easing effect is spread out over that distance. If I have an image being bounced off my 428px wide phone to 4 screens off to the right then I'm going to miss a lot of that effect. The effective speed may be technically more consistent but suddenly the distinction between the different animations is lost. I'd much rather see the 2000px set as an additional variable instead so I can adjust it to 100vw or 200vw myself and change the durations accordingly. |
I would like to highlight a few things that can be fixed in upcoming versions.
Back entrances
0%
, there is stuff liketranslateY(-1200px) scale(0.7)
withopacity: 0.7
. Does these magic values (1200, 2000, etc.) work on all screen resolutions (especially 4K screens or like)? By "work", I meant it is an entrance, it should come from off-screen. Why not define these in terms ofvh
/vw
/%
? Anyway, I think at leastopacity: 0
can be maintained on entrances.Back exits
100%
(animation complete), the element is still visible becauseopacity
is not0
. Also, there is inconsistent convention, at some keyframes there isfrom
,to
at others0%
,100%
. A project wide convention on these would be nice I guess. Also at many placesfrom
/to
is not necessary (as done in zoom animations), that can also be made consistent.Sliding entrances/exits
visibility
properties in them. Only these animations actually inject/remove elements from the accessibility tree. I think this can be tested on all entrances/exits.Accessibility
transition-duration
set to1ms
? Doesn't only settinganimation-duration
to1ms
does the job and completes the animation as soon as possible?Bounce Entrances
There is code like this:
Why not simply do this instead:
3D transform functions
translateX
, etc (inheadshake
for example). The major part is although is usingtranslate3d
and friends. This can also be modified.Jello
skewX(ax) skewY(ay)
can be changed toskew(ax, ay)
.The text was updated successfully, but these errors were encountered: