pub enum Length {
Px(f32),
Rpx(f32),
Ppx(f32),
Em(f32),
Rem(f32),
Vh(f32),
Vw(f32),
Zero,
}Expand description
A CSS <length> value.
Variants§
Px(f32)
Logical pixels (px). Maps to iOS points and Android dp.
Rpx(f32)
Lynx-specific responsive pixel (rpx). 750rpx equals the
device’s screen width regardless of pixel density.
Ppx(f32)
Physical pixels (ppx). One device pixel.
Em(f32)
Em (em) — relative to the element’s computed font-size.
Rem(f32)
Root em (rem) — relative to the root element’s
computed font-size.
Vh(f32)
Viewport height (vh) — 1% of the viewport’s height.
Vw(f32)
Viewport width (vw) — 1% of the viewport’s width.
Zero
The unitless zero. CSS allows 0 (and only 0) without a
unit; this variant covers that case so a non-zero unit-less
length is unrepresentable.
Implementations§
Trait Implementations§
impl Copy for Length
Source§impl From<Length> for LengthPercentage
impl From<Length> for LengthPercentage
Source§impl From<Length> for MarginValue
impl From<Length> for MarginValue
Source§impl From<Length> for LineHeight
impl From<Length> for LineHeight
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