pub enum Transition {
One(TransitionValue),
Multiple(IndexMap<Cow<'static, str>, TransitionValue>),
Initial,
Inherit,
None,
Unset,
}
Expand description
use css_style::{prelude::*, unit::{sec, ms}};
style()
// transition for all properties
.and_transition(|conf| conf.duration(sec(1.2)).ease())
// transitions for specific properties
.and_transition(|conf| {
conf.insert("opacity", |conf| conf.duration(ms(150.)).ease().delay(sec(0.5)))
.insert("width", |conf| conf.duration(ms(450.)).ease_in())
});
Variants§
One(TransitionValue)
Multiple(IndexMap<Cow<'static, str>, TransitionValue>)
Initial
Inherit
None
Unset
Implementations§
Source§impl Transition
impl Transition
pub fn new() -> Self
pub fn duration(self, val: impl Into<Duration>) -> Self
pub fn timing_function(self, val: impl Into<TimingFunction>) -> Self
pub fn try_timing_function(self, val: Option<impl Into<TimingFunction>>) -> Self
pub fn ease(self) -> Self
pub fn linear(self) -> Self
pub fn ease_in(self) -> Self
pub fn ease_out(self) -> Self
pub fn ease_in_out(self) -> Self
pub fn step_start(self) -> Self
pub fn step_end(self) -> Self
pub fn steps(self, intervals: usize, pos: impl Into<StepsPos>) -> Self
pub fn cubic_bezier(self, n1: f32, n2: f32, n3: f32, n4: f32) -> Self
pub fn delay(self, val: impl Into<Delay>) -> Self
pub fn try_delay(self, val: Option<impl Into<Delay>>) -> Self
pub fn insert( self, property: impl Into<Cow<'static, str>>, get_val: impl FnOnce(TransitionValue) -> TransitionValue, ) -> Self
pub fn foreach( self, properties: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, f: impl FnOnce(TransitionValue) -> TransitionValue + Clone, ) -> Self
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
Source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Transition
impl Debug for Transition
Source§impl Default for Transition
impl Default for Transition
Source§impl Display for Transition
impl Display for Transition
Source§impl<__FromT0> From<__FromT0> for Transitionwhere
TransitionValue: From<__FromT0>,
impl<__FromT0> From<__FromT0> for Transitionwhere
TransitionValue: From<__FromT0>,
Source§fn from(original: __FromT0) -> Transition
fn from(original: __FromT0) -> Transition
Converts to this type from the input type.
Source§impl PartialEq for Transition
impl PartialEq for Transition
Source§impl StyleUpdater for Transition
impl StyleUpdater for Transition
fn update_style(self, style: Style) -> Style
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnwindSafe for Transition
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more