pub enum CssValue {
Px(f32),
Pct(f32),
Em(f32),
Rem(f32),
Vw(f32),
Vh(f32),
Auto,
}Expand description
A CSS dimension value that can be used in any property context.
This is the user-facing type. Implements Into<Size>, Into<Margin>,
Into<NonNegativeLengthPercentage> so it can be passed to any
StyleAccess method.
Variants§
Px(f32)
A pixel value (e.g., 200px).
Pct(f32)
A percentage (e.g., 50%).
Em(f32)
An em value (e.g., 1.5em).
Rem(f32)
A rem value (e.g., 2rem).
Vw(f32)
A viewport-width value (e.g., 100vw).
Vh(f32)
A viewport-height value (e.g., 100vh).
Auto
The auto keyword.
Trait Implementations§
Source§impl From<CssValue> for NonNegativeLengthPercentage
Into NonNegativeLengthPercentage (for padding-*): no auto.
impl From<CssValue> for NonNegativeLengthPercentage
Into NonNegativeLengthPercentage (for padding-*): no auto.
impl Copy for CssValue
Auto Trait Implementations§
impl Freeze for CssValue
impl RefUnwindSafe for CssValue
impl Send for CssValue
impl Sync for CssValue
impl Unpin for CssValue
impl UnsafeUnpin for CssValue
impl UnwindSafe for CssValue
Blanket Implementations§
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert