pub enum Length {
Px(f32),
Em(f32),
Rem(f32),
Percent(f32),
Vw(f32),
Vh(f32),
Vmin(f32),
Vmax(f32),
Fr(f32),
Token(Spacing),
Auto,
}Expand description
A length in abstract units, CSS-style.
Everything resolves to logical units (points on macOS, effective pixels on Windows, logical pixels on GTK), so layouts are DPI-independent.
Variants§
Px(f32)
Logical pixels.
Em(f32)
Multiple of the node’s inherited font size.
Rem(f32)
Multiple of the platform body font size (follows the user’s text size setting).
Percent(f32)
Percentage (0–100) of the containing block.
Vw(f32)
Percentage of the window content width.
Vh(f32)
Percentage of the window content height.
Vmin(f32)
Vmax(f32)
Fr(f32)
Fraction of the free space. Grid tracks only; elsewhere it acts as Auto.
Token(Spacing)
A platform spacing token.
Auto
Implementations§
Trait Implementations§
impl Copy for Length
impl StructuralPartialEq for Length
Auto Trait Implementations§
impl Freeze for Length
impl RefUnwindSafe for Length
impl Send for Length
impl Sync for Length
impl Unpin for Length
impl UnsafeUnpin for Length
impl UnwindSafe for Length
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