Repository navigation
Web HIG tip #6: Application CSS must not use transition: all #15
frozonfreak
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
transition: alllooks convenient until a new property starts animating and the UI jumps in ways you never meant.Web HIG tip #6 (Quick #85, HIG-MOT-001): Application CSS must not use
transition: all— enumerate animated properties explicitly.Why it matters
A single
alltransition is a blank cheque:width,height,top, orleftlater can suddenly animate layout and make the UI feel sluggish or jumpyThe rule of thumb
Ask: if someone added a new property to this rule tomorrow, would it start animating by accident?
If yes, replace
allwith the properties you actually want.Prefer
transformandopacitywhen they can do the job. Layout transitions aren't forbidden; you just have to list them on purpose.Do this instead
transition(or usetransition-property)0.3s(Quick #87)Quick check for your app
Search your application styles for
transition: allandtransition-property: all. Each hit should become an explicit list, or be removed if no animation is intended. Skipnode_modulesand other vendor CSS.The Web HIG is a behavioral contract for how the web should behave, not a component library. Design systems define how it looks. The Web HIG defines how it behaves.
All reactions