You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Animation and transitions should be disabled anything from @wp-g2 respecting reducedMotion configs (whether that's an app specific config, or a user machine config).
From a DX perspective, Animation/transition disabling/enabling should be invisible.
Therefore, this has to be supported at the core system level.
It uses the createStore function from @wp-g2/context (zustand under the hood) to track + coordinated state in a dedicated stream.
This allows for Animated components to recognize app controlled useReducedMotion without requiring a wrapping Provider!
The implementation of this is tricky as Animated (motion from Framer Motion) animates style properties in their own render loop(s). For example, manually incrementing height from 0px to 100px. Therefore, a blanket transition: none !important will not work.
To achieve the a seamless system-supported setup, we have to intercept and adjust the transition property being passed to motion.div based on our (new) useReducedMotion state.
Closing this up! We have system-wide reduced motion support via the Style System. This configuration can also be controlled programatically (via JS) in addition to understanding and respecting the user's device preference.
Animation and transitions should be disabled anything from
@wp-g2
respecting reducedMotion configs (whether that's an app specific config, or a user machine config).From a DX perspective, Animation/transition disabling/enabling should be invisible.
Therefore, this has to be supported at the core system level.
I have the foundations of this working:
https://github.com/ItsJonQ/g2/blob/master/packages/styles/src/create-system/createSystemElement.js#L20
For this to work, reduceMotion needs to automatically kick in for anything using...
@wp-g2/animations
@wp-g2/styles
css
styled
View
@wp-g2/components
AnimatedView
View
The text was updated successfully, but these errors were encountered: