Skip to main content

Module length

Module length 

Source
Expand description

Re-exportsยง

pub use super::image::Image;
pub use super::image::EndingShape as GradientEndingShape;
pub use super::image::Gradient;

Macrosยง

parse_fit_content_function ๐Ÿ”’
parse_size_non_length ๐Ÿ”’

Structsยง

Length
An extension to NoCalcLength to parse calc expressions. This is commonly used for the <length> values.
NoCalcLength
A <length> without taking calc expressions into account

Enumsยง

FontBaseSize
A source to resolve font-relative units against
LengthPercentage
A <length-percentage> value. This can be either a <length>, a <percentage>, or a combination of both via calc().
LengthUnit
The unit of a <length> value. Note that if any new font-relative value is added here, custom_properties::NonCustomReferences::from_unit must also be updated. Consult the comment in that function as to why.
LineHeightBase
A source to resolve font-relative line-height units against.
ParseAnchorFunctions ๐Ÿ”’
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

Traitsยง

EqualsPercentage
Check if this equal to a specific percentage.

Functionsยง

is_fit_content_function_enabled ๐Ÿ”’
is_stretch_enabled ๐Ÿ”’
is_webkit_fill_available_enabled_in_all_size_properties ๐Ÿ”’
is_webkit_fill_available_enabled_in_width_and_height ๐Ÿ”’

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.