style::values::computed::length

Type Alias LengthPercentageOrAuto

source
pub type LengthPercentageOrAuto = GenericLengthPercentageOrAuto<LengthPercentage>;
Expand description

A computed type for <length-percentage> | auto.

Aliased Type§

enum LengthPercentageOrAuto {
    LengthPercentage(LengthPercentage),
    Auto,
}

Variants§

§

LengthPercentage(LengthPercentage)

§

Auto

Implementations§

source§

impl LengthPercentageOrAuto

source

pub fn clamp_to_non_negative(self) -> Self

Clamps the value to a non-negative value.

source

pub fn as_ref(&self) -> GenericLengthPercentageOrAuto<&LengthPercentage>

Convert to have a borrow inside the enum

source

pub fn to_used_value(&self, percentage_basis: Au) -> Option<Au>

Returns the used value.

source

pub fn is_definitely_zero(&self) -> bool

Returns true if the computed value is absolute 0 or 0%.