Module length

Source
Expand description

Re-exports§

pub use super::image::Image;
pub use super::image::EndingShape as GradientEndingShape;
pub use super::image::Gradient;
pub use crate::values::specified::calc::CalcLengthPercentage;

Macros§

parse_fit_content_function 🔒
parse_size_non_length 🔒

Structs§

CharacterWidth
HTML5 “character width”, as defined in HTML5 § 14.5.4.

Enums§

AbsoluteLength
Represents an absolute length with its unit
ContainerRelativeLength
A container query length.
FontBaseSize
A source to resolve font-relative units against
FontRelativeLength
A font relative length. Note that if any new value is added here, custom_properties::NonCustomReferences::from_unit must also be updated. Consult the comment in that function as to why.
Length
An extension to NoCalcLength to parse calc expressions. This is commonly used for the <length> values.
LengthPercentage
A <length-percentage> value. This can be either a <length>, a <percentage>, or a combination of both via calc().
LineHeightBase
A source to resolve font-relative line-height units against.
NoCalcLength
A <length> without taking calc expressions into account
ViewportPercentageLength
A viewport-relative length.
ViewportUnit 🔒
https://drafts.csswg.org/css-values/#viewport-relative-units
ViewportVariant
https://drafts.csswg.org/css-values/#viewport-variants

Constants§

PX_PER_CM
Number of pixels per centimeter
PX_PER_IN
Number of pixels per inch
PX_PER_MM
Number of pixels per millimeter
PX_PER_PC
Number of pixels per pica
PX_PER_PT
Number of pixels per point
PX_PER_Q
Number of pixels per quarter

Functions§

is_fit_content_function_enabled 🔒
is_stretch_enabled 🔒

Type Aliases§

LengthOrAuto
Either a <length> or the auto keyword.
LengthOrNumber
Either a <length> or a <number>.
LengthPercentageOrAuto
A specified type for <length-percentage> | auto.
Margin
A specified value for margin properties.
MaxSize
A specified value for max-width or max-height property.
NonNegativeLength
A wrapper of Length, whose value must be >= 0.
NonNegativeLengthOrAuto
Either a non-negative <length> or the auto keyword.
NonNegativeLengthOrNumber
A specified non-negative <length> | <number>.
NonNegativeLengthPercentage
A wrapper of LengthPercentage, whose value must be >= 0.
NonNegativeLengthPercentageOrAuto
A wrapper of LengthPercentageOrAuto, whose value must be >= 0.
NonNegativeLengthPercentageOrNormal
Either a NonNegativeLengthPercentage or the normal keyword.
Size
A specified value for min-width, min-height, width or height property.