pub enum SpacingLength {
Px(Px),
Fraction(f32),
Fill,
}Expand description
A length type for spacing (padding/gap) that can express percent sizing but has no auto.
Taffy resolves percent padding/border against the containing block width (inline size),
including vertical edges (CSS-like). We mirror that behavior in the declarative bridge by
resolving percent spacing only when the containing block width is definite; otherwise it
resolves to 0 (definite-only).
Variants§
Px(Px)
Fraction(f32)
Fraction of the containing block size (percent spacing).
Expressed as a ratio (e.g. 0.5 for 50%).
Fill
Shorthand for 100% (equivalent intent to Fraction(1.0)).
Implementations§
Trait Implementations§
Source§impl Clone for SpacingLength
impl Clone for SpacingLength
Source§fn clone(&self) -> SpacingLength
fn clone(&self) -> SpacingLength
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 SpacingLength
impl Debug for SpacingLength
Source§impl Default for SpacingLength
impl Default for SpacingLength
Source§impl From<Px> for SpacingLength
impl From<Px> for SpacingLength
Source§impl PartialEq for SpacingLength
impl PartialEq for SpacingLength
impl Copy for SpacingLength
impl StructuralPartialEq for SpacingLength
Auto Trait Implementations§
impl Freeze for SpacingLength
impl RefUnwindSafe for SpacingLength
impl Send for SpacingLength
impl Sync for SpacingLength
impl Unpin for SpacingLength
impl UnsafeUnpin for SpacingLength
impl UnwindSafe for SpacingLength
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