Type Alias lightningcss::values::length::LengthPercentage

source ·
pub type LengthPercentage = DimensionPercentage<LengthValue>;
Expand description

A CSS <length-percentage> value. May be specified as either a length or a percentage that resolves to an length.

Aliased Type§

enum LengthPercentage {
    Dimension(LengthValue),
    Percentage(Percentage),
    Calc(Box<Calc<DimensionPercentage<LengthValue>>>),
}

Variants§

§

Dimension(LengthValue)

An explicit dimension value.

§

Percentage(Percentage)

A percentage.

§

Calc(Box<Calc<DimensionPercentage<LengthValue>>>)

A calc() expression.

Implementations§

source§

impl LengthPercentage

source

pub fn px(val: CSSNumber) -> LengthPercentage

Constructs a LengthPercentage with the given pixel value.

Trait Implementations§

source§

impl IsCompatible for LengthPercentage

source§

fn is_compatible(&self, browsers: Browsers) -> bool

Returns whether the value is compatible with all of the given browser targets.