package toffee

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Track_sizing_function.MaxSource

Operations on the maximum sizing function component.

Sourceval is_intrinsic : t -> bool

is_intrinsic t returns true if the max component is min-content, max-content, fit-content, or auto.

Sourceval is_max_content_alike : t -> bool

is_max_content_alike t returns true if the max component is max-content, fit-content, or auto.

Per the CSS Grid specification, auto and fit-content are treated as max-content in most contexts.

Sourceval is_fr : t -> bool

is_fr t returns true if the max component is an fr value.

Sourceval is_auto : t -> bool

is_auto t returns true if the max component is auto.

Sourceval is_min_content : t -> bool

is_min_content t returns true if the max component is min-content.

Sourceval is_max_content : t -> bool

is_max_content t returns true if the max component is max-content.

Sourceval is_fit_content : t -> bool

is_fit_content t returns true if the max component is fit-content.

Sourceval is_max_or_fit_content : t -> bool

is_max_or_fit_content t returns true if the max component is max-content or fit-content.

Sourceval fr_value : t -> float

fr_value t returns the fr coefficient if the max component is an fr value. Returns 0.0 otherwise.

Sourceval has_definite_value : t -> float option -> bool

has_definite_value t parent_size returns true if the max component can be resolved to a concrete value given parent_size.

Sourceval definite_value : t -> float option -> float option

definite_value t parent_size resolves the max component to a concrete value.

Returns Some value for fixed lengths or percentages (when parent_size is Some). Returns None for intrinsic or flexible values.

Sourceval definite_value_with_calc : t -> float option -> (int -> float -> float) -> float option

definite_value_with_calc t parent_size calc_resolver resolves the max component, including calc() expressions.

The calc_resolver is called with a calc index and parent size to resolve calc values.

Sourceval definite_limit : t -> float option -> float option

definite_limit t parent_size resolves the maximum limit of the track.

For fit-content values, returns the fit-content limit. Otherwise behaves like definite_value.

Sourceval definite_limit_with_calc : t -> float option -> (int -> float -> float) -> float option

definite_limit_with_calc t parent_size calc_resolver resolves the maximum limit, including calc() expressions in fit-content arguments.

Sourceval resolved_percentage_size : t -> float -> float option

resolved_percentage_size t parent_size resolves percentage values.

Returns Some (value * parent_size) for percentage values. Returns None otherwise.

Sourceval uses_percentage : t -> bool

uses_percentage t returns true if the max component depends on parent size.