pub enum Unit {
Show 30 variants
Em,
Ex,
Ch,
Rem,
Vw,
Vh,
Vmin,
Vmax,
Cm,
Mm,
Q,
In,
Pt,
Pc,
Px,
Deg,
Grad,
Rad,
Turn,
S,
Ms,
Hz,
Khz,
Dpi,
Dpcm,
Dppx,
Percent,
Fr,
None,
Unknown(String),
}
Expand description
Units in css.
As defined in https://www.w3.org/TR/css3-values/
Variants§
Em
em
unit, lengths in em-like dimension.
Ex
ex
unit, lengths in em-like dimension.
Ch
ch
unit, lengths in em-like dimension.
Rem
ch
unit, lengths in rem-like dimension.
Vw
vw
unit, length relative to viewport width.
Vh
vh
unit, length relative to viewport height.
Vmin
vmin
unit, length relative to min viewport size.
Vmax
vmax
unit, length relative to max viewport size.
Cm
cm
unit, absolute length.
Mm
mm
unit, absolute length.
Q
q
unit, absolute length (4Q == 1mm).
In
in
unit, absolute length in inch.
Pt
pt
unit, absolute length (72pt == 1in).
Pc
pc
unit, absolute length (1pc == 12pt, 6pc == 1in).
Px
px
unit, originally pixel size, but does not really mean anything now.
Deg
deg
unit, angle in degrees (360 to a turn).
Grad
grad
unit, angle in grad (400 to a turn).
Rad
rad
unit, angle in degrees (2pi to a turn).
Turn
turn
unit, angle in turns.
S
s
unit, time in seconds.
Ms
ms
unit, time in milliseconds.
Hz
hz
unit, frequency in Hz.
Khz
khz
unit, frequency in kHz.
Dpi
dpi
unit, resolution in dots per inch.
Dpcm
dpcm
unit, resolution in dots per cm.
Dppx
dppx
unit, resolution in dots per px unit.
Percent
%
unit, a percentage of something.
Fr
fr
unit, for grid-relative lengths.
None
No unit.
Unknown(String)
An unknown (but named) unit.
Implementations§
Trait Implementations§
source§impl Ord for Unit
impl Ord for Unit
source§impl PartialEq for Unit
impl PartialEq for Unit
source§impl PartialOrd for Unit
impl PartialOrd for Unit
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more