pub enum LengthValue {
Show 49 variants
Px(CSSNumber),
In(CSSNumber),
Cm(CSSNumber),
Mm(CSSNumber),
Q(CSSNumber),
Pt(CSSNumber),
Pc(CSSNumber),
Em(CSSNumber),
Rem(CSSNumber),
Ex(CSSNumber),
Rex(CSSNumber),
Ch(CSSNumber),
Rch(CSSNumber),
Cap(CSSNumber),
Rcap(CSSNumber),
Ic(CSSNumber),
Ric(CSSNumber),
Lh(CSSNumber),
Rlh(CSSNumber),
Vw(CSSNumber),
Lvw(CSSNumber),
Svw(CSSNumber),
Dvw(CSSNumber),
Cqw(CSSNumber),
Vh(CSSNumber),
Lvh(CSSNumber),
Svh(CSSNumber),
Dvh(CSSNumber),
Cqh(CSSNumber),
Vi(CSSNumber),
Svi(CSSNumber),
Lvi(CSSNumber),
Dvi(CSSNumber),
Cqi(CSSNumber),
Vb(CSSNumber),
Svb(CSSNumber),
Lvb(CSSNumber),
Dvb(CSSNumber),
Cqb(CSSNumber),
Vmin(CSSNumber),
Svmin(CSSNumber),
Lvmin(CSSNumber),
Dvmin(CSSNumber),
Cqmin(CSSNumber),
Vmax(CSSNumber),
Svmax(CSSNumber),
Lvmax(CSSNumber),
Dvmax(CSSNumber),
Cqmax(CSSNumber),
}
Variants§
Px(CSSNumber)
A length in pixels.
In(CSSNumber)
A length in inches. 1in = 96px.
Cm(CSSNumber)
A length in centimeters. 1cm = 96px / 2.54.
Mm(CSSNumber)
A length in millimeters. 1mm = 1/10th of 1cm.
Q(CSSNumber)
A length in quarter-millimeters. 1Q = 1/40th of 1cm.
Pt(CSSNumber)
A length in points. 1pt = 1/72nd of 1in.
Pc(CSSNumber)
A length in picas. 1pc = 1/6th of 1in.
Em(CSSNumber)
A length in the em
unit. An em
is equal to the computed value of the
font-size property of the element on which it is used.
Rem(CSSNumber)
A length in the rem
unit. A rem
is equal to the computed value of the
em
unit on the root element.
Ex(CSSNumber)
A length in ex
unit. An ex
is equal to the x-height of the font.
Rex(CSSNumber)
A length in the rex
unit. A rex
is equal to the value of the ex
unit on the root element.
Ch(CSSNumber)
A length in the ch
unit. A ch
is equal to the width of the zero (“0”) character in the current font.
Rch(CSSNumber)
A length in the rch
unit. An rch
is equal to the value of the ch
unit on the root element.
Cap(CSSNumber)
A length in the cap
unit. A cap
is equal to the cap-height of the font.
Rcap(CSSNumber)
A length in the rcap
unit. An rcap
is equal to the value of the cap
unit on the root element.
Ic(CSSNumber)
A length in the ic
unit. An ic
is equal to the width of the “水” (CJK water ideograph) character in the current font.
Ric(CSSNumber)
A length in the ric
unit. An ric
is equal to the value of the ic
unit on the root element.
Lh(CSSNumber)
A length in the lh
unit. An lh
is equal to the computed value of the line-height
property.
Rlh(CSSNumber)
A length in the rlh
unit. An rlh
is equal to the value of the lh
unit on the root element.
Vw(CSSNumber)
A length in the vw
unit. A vw
is equal to 1% of the viewport width.
Lvw(CSSNumber)
A length in the lvw
unit. An lvw
is equal to 1% of the large viewport width.
Svw(CSSNumber)
A length in the svw
unit. An svw
is equal to 1% of the small viewport width.
Dvw(CSSNumber)
A length in the dvw
unit. An dvw
is equal to 1% of the dynamic viewport width.
Cqw(CSSNumber)
A length in the cqw
unit. An cqw
is equal to 1% of the query container width.
Vh(CSSNumber)
A length in the vh
unit. A vh
is equal to 1% of the viewport height.
Lvh(CSSNumber)
A length in the lvh
unit. An lvh
is equal to 1% of the large viewport height.
Svh(CSSNumber)
A length in the svh
unit. An svh
is equal to 1% of the small viewport height.
Dvh(CSSNumber)
A length in the dvh
unit. An dvh
is equal to 1% of the dynamic viewport height.
Cqh(CSSNumber)
A length in the cqh
unit. An cqh
is equal to 1% of the query container height.
Vi(CSSNumber)
A length in the vi
unit. A vi
is equal to 1% of the viewport size
in the box’s inline axis.
Svi(CSSNumber)
A length in the svi
unit. A svi
is equal to 1% of the small viewport size
in the box’s inline axis.
Lvi(CSSNumber)
A length in the lvi
unit. A lvi
is equal to 1% of the large viewport size
in the box’s inline axis.
Dvi(CSSNumber)
A length in the dvi
unit. A dvi
is equal to 1% of the dynamic viewport size
in the box’s inline axis.
Cqi(CSSNumber)
A length in the cqi
unit. An cqi
is equal to 1% of the query container inline size.
Vb(CSSNumber)
A length in the vb
unit. A vb
is equal to 1% of the viewport size
in the box’s block axis.
Svb(CSSNumber)
A length in the svb
unit. A svb
is equal to 1% of the small viewport size
in the box’s block axis.
Lvb(CSSNumber)
A length in the lvb
unit. A lvb
is equal to 1% of the large viewport size
in the box’s block axis.
Dvb(CSSNumber)
A length in the dvb
unit. A dvb
is equal to 1% of the dynamic viewport size
in the box’s block axis.
Cqb(CSSNumber)
A length in the cqb
unit. An cqb
is equal to 1% of the query container block size.
Vmin(CSSNumber)
A length in the vmin
unit. A vmin
is equal to the smaller of vw
and vh
.
Svmin(CSSNumber)
A length in the svmin
unit. An svmin
is equal to the smaller of svw
and svh
.
Lvmin(CSSNumber)
A length in the lvmin
unit. An lvmin
is equal to the smaller of lvw
and lvh
.
Dvmin(CSSNumber)
A length in the dvmin
unit. A dvmin
is equal to the smaller of dvw
and dvh
.
Cqmin(CSSNumber)
A length in the cqmin
unit. An cqmin
is equal to the smaller of cqi
and cqb
.
Vmax(CSSNumber)
A length in the vmax
unit. A vmax
is equal to the larger of vw
and vh
.
Svmax(CSSNumber)
A length in the svmax
unit. An svmax
is equal to the larger of svw
and svh
.
Lvmax(CSSNumber)
A length in the lvmax
unit. An lvmax
is equal to the larger of lvw
and lvh
.
Dvmax(CSSNumber)
A length in the dvmax
unit. An dvmax
is equal to the larger of dvw
and dvh
.
Cqmax(CSSNumber)
A length in the cqmax
unit. An cqmin
is equal to the larger of cqi
and cqb
.
Implementations§
Source§impl LengthValue
impl LengthValue
Sourcepub fn to_unit_value(&self) -> (CSSNumber, &str)
pub fn to_unit_value(&self) -> (CSSNumber, &str)
Returns the numeric value and unit string for the length value.
Trait Implementations§
Source§impl Clone for LengthValue
impl Clone for LengthValue
Source§fn clone(&self) -> LengthValue
fn clone(&self) -> LengthValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LengthValue
impl Debug for LengthValue
Source§impl<'de> Deserialize<'de> for LengthValue
impl<'de> Deserialize<'de> for LengthValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'any> IntoOwned<'any> for LengthValue
impl<'any> IntoOwned<'any> for LengthValue
Source§type Owned = LengthValue
type Owned = LengthValue
Self
with a new lifetime.Source§fn into_owned(self) -> Self
fn into_owned(self) -> Self
self
'static
.Source§impl IsCompatible for LengthValue
impl IsCompatible for LengthValue
Source§fn is_compatible(&self, browsers: Browsers) -> bool
fn is_compatible(&self, browsers: Browsers) -> bool
Source§impl JsonSchema for LengthValue
Available on crate feature jsonschema
only.
impl JsonSchema for LengthValue
jsonschema
only.Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn schema_name() -> String
fn schema_name() -> String
Source§impl Map for LengthValue
impl Map for LengthValue
Source§impl Mul<f32> for LengthValue
impl Mul<f32> for LengthValue
Source§type Output = LengthValue
type Output = LengthValue
*
operator.Source§impl<'i> Parse<'i> for LengthValue
impl<'i> Parse<'i> for LengthValue
Source§fn parse<'t>(
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>( input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i, ParserError<'i>>>
Source§fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Source§impl PartialEq for LengthValue
impl PartialEq for LengthValue
Source§impl PartialOrd for LengthValue
impl PartialOrd for LengthValue
Source§impl Serialize for LengthValue
impl Serialize for LengthValue
Source§impl Sign for LengthValue
impl Sign for LengthValue
Source§impl ToCss for LengthValue
impl ToCss for LengthValue
Source§fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>,
) -> Result<(), PrinterError>where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>,
) -> Result<(), PrinterError>where
W: Write,
self
in CSS syntax, writing to dest
.Source§fn to_css_string(
&self,
options: PrinterOptions<'_>,
) -> Result<String, PrinterError>
fn to_css_string( &self, options: PrinterOptions<'_>, ) -> Result<String, PrinterError>
self
in CSS syntax and return a string. Read moreSource§impl<'i> TryFrom<&Token<'i>> for LengthValue
impl<'i> TryFrom<&Token<'i>> for LengthValue
Source§impl TryFrom<Angle> for LengthValue
impl TryFrom<Angle> for LengthValue
Source§impl TryOp for LengthValue
impl TryOp for LengthValue
Source§impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for LengthValue
impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for LengthValue
Source§const CHILD_TYPES: VisitTypes
const CHILD_TYPES: VisitTypes
visitor
only.Source§impl Zero for LengthValue
impl Zero for LengthValue
impl StructuralPartialEq for LengthValue
Auto Trait Implementations§
impl Freeze for LengthValue
impl RefUnwindSafe for LengthValue
impl Send for LengthValue
impl Sync for LengthValue
impl Unpin for LengthValue
impl UnwindSafe for LengthValue
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more