Skip to main content

Module unit

Module unit 

Source
Expand description

Unit types and helpers for Floem styles.

Floem’s length model is intentionally small:

  • Pt is the primary absolute length unit exposed by the style API.
  • Pct resolves against a property-specific basis such as parent size.
  • Em resolves against the current element’s computed font size.
  • Lh resolves against the current element’s computed line height.

Floem treats absolute lengths as logical layout points rather than device pixels. The renderer later maps those logical values through the window scale factor, so callers should generally think in view-space measurements, not physical screen pixels.

Relative text units are scoped to the current element. Floem does not currently define a separate root-level font-size or line-height unit in this module.

Structs§

AnchorAbout
Anchor point for transform-origin, used with rotate and scale transformations.
Auto
Used for automatically computed values
Em
A length relative to the current element’s computed font size.
FontSizeCx
Lh
A length relative to the current element’s computed line height.
Pct
A percent value
Pt
An absolute length value in Floem layout points.
PxDeprecated

Enums§

Angle
An angle value that can be in degrees or radians.
Length
LengthAuto
LineHeightValue
Specifies how line height is computed for text layout.
PxPctDeprecated
PxPctAutoDeprecated

Traits§

DurationUnitExt
UnitExt