monks/animation_fill_mode
The animation-fill-mode CSS property sets how a CSS animation applies styles to its target before and after its execution.
It is often convenient to use the shorthand property {{cssxref(“animation”)}} to set all animation properties at once.
Values
pub const backwards: #(String, String)
- : The animation will apply the values defined in the first relevant keyframe as soon as it is applied to the target, and retain this during the {{cssxref(“animation-delay”)}} period. The first relevant keyframe depends on the value of {{cssxref(“animation-direction”)}}: |
animation-direction| first relevant keyframe | | –––––––––––––––– | ———————– | |normaloralternate|0%orfrom| |reverseoralternate-reverse|100%orto|
pub const both: #(String, String)
- : The animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions.> [!NOTE]> When you specify multiple comma-separated values on an
animation-*property, they are applied to the animations in the order in which the {{cssxref(“animation-name”)}}s appear. For situations where the number of animations andanimation-*property values do not match, see Setting multiple animation property values.> [!NOTE]>animation-fill-modehas the same effect when creating CSS scroll-driven animations as it does for regular time-based animations.
pub const forwards: #(String, String)
- : The target will retain the computed values set by the last keyframe encountered during execution. The last keyframe depends on the value of {{cssxref(“animation-direction”)}} and {{cssxref(“animation-iteration-count”)}}: |
animation-direction|animation-iteration-count| last keyframe encountered | | ——————— | ————————— | ———————–– | |normal| even or odd |100%orto| |reverse| even or odd |0%orfrom| |alternate| even |0%orfrom| |alternate| odd |100%orto| |alternate-reverse| even |100%orto| |alternate-reverse| odd |0%orfrom| Animated properties behave as if included in a setwill-changeproperty value. If a new stacking context was created during the animation, the target element retains the stacking context after the animation has finished.
pub const none: #(String, String)
- : The animation will not apply any styles to the target when it’s not executing. The element will instead be displayed using any other CSS rules applied to it. This is the default value.
pub fn raw(value: String) -> #(String, String)
Enter a raw string value for animation-fill-mode
pub const revert_layer: #(String, String)