Style.Grid_template_componentSourceGrid template component definitions.
A grid template component represents an element in a grid-template-columns or grid-template-rows definition. It is either a single track sizing function or a repeat() clause.
type t = | Single of Track_sizing_function.tA single non-repeated track sizing function.
*)| Repeat of Grid_repetition.tA repeat() clause that generates multiple tracks.
single tsf creates a component with a single track sizing function.
repeat rep creates a component with a repeat() clause.
These constructors create Single components with commonly used track sizing functions.
auto creates a component with automatic track sizing.
Equivalent to Single Track_sizing_function.auto.
min_content creates a component with min-content track sizing.
The track size is the minimum size required to fit the content with all soft line-wrapping opportunities taken.
Equivalent to Single Track_sizing_function.min_content.
max_content creates a component with max-content track sizing.
The track size is the minimum size required to fit the content with no soft line-wrapping opportunities taken.
Equivalent to Single Track_sizing_function.max_content.
zero creates a component with zero-sized track.
Equivalent to Single Track_sizing_function.zero.
fr value creates a component with flexible track sizing.
The track takes a fraction of the available space. The value is the numerator; the denominator is the sum of all fr values in the grid dimension.
See CSS Grid: fr unit.
Equivalent to Single (Track_sizing_function.fr value).
length value creates a component with fixed length track sizing.
Equivalent to Single (Track_sizing_function.length value).
percent value creates a component with percentage-based track sizing.
The value is a fraction in the range 0.0, 1.0, where 0.5 represents 50%. Equivalent to Single (Track_sizing_function.percent value).
fit_content lp creates a component with fit-content track sizing.
The track size is computed as max(min_content, min(max_content, lp)), clamping the available space by the content's min and max sizes.
Equivalent to Single (Track_sizing_function.fit_content lp).
minmax ~min ~max creates a component with minmax track sizing.
The track automatically sizes between min and max based on content and available space.
Equivalent to Single (Track_sizing_function.minmax ~min ~max).
is_auto_repetition t returns true if t is a Repeat with automatic repetition count (Auto_fill or Auto_fit).
Returns false for Single components or Repeat components with a fixed Count.
compare a b returns a total ordering on components.
Single components sort before Repeat components.
to_string t returns a CSS-like string representation of the component.
pp fmt t prints the component to the formatter.