Style.Grid_placementSourceCSS Grid item placement specification.
This module defines how grid items are positioned within a CSS Grid container using line-based placement. It supports CSS grid line coordinates, named grid lines, and span-based placement.
Grid lines use CSS coordinates where positive indices start from 1 at the grid's start edge and negative indices start from -1 at the grid's end edge. Line index 0 is invalid and treated as Auto.
Grid line coordinate in CSS Grid coordinates.
Positive values start from 1 at the grid's start edge. Negative values start from -1 at the grid's end edge. The value 0 is invalid and treated as Auto.
type t = | AutoPlace item according to auto-placement algorithm.
*)| Line of grid_linePlace item at specified line index.
*)| Named_line of string * intPlace item at specified named line. The string is the line name and the int is the occurrence count (e.g., the 2nd line named "header").
*)| Span of intItem spans specified number of tracks.
*)| Named_span of string * intItem spans until the nth line named with the given string.
*)Grid placement specification for a single axis.
Defaults to Auto.
line index creates a line-based placement at index.
Line 0 is invalid and will be treated as Auto during layout.
named_line name index creates a placement at the indexth occurrence of the named line name.
named_span name count creates a span until the countth occurrence of the named line name.
is_definite placement returns true if the placement is definite.
A placement is definite if it specifies a non-zero line index or a named line. Auto and Span values are indefinite. Line 0 is invalid and treated as Auto, thus indefinite.
into_origin_zero_placement_ignoring_named placement explicit_track_count converts placement to origin-zero coordinates, ignoring named lines.
Named lines and named spans are converted to Auto. Line 0 is converted to Auto. Other line placements are converted using explicit_track_count to translate CSS grid coordinates (1-indexed, negatives from end) to origin-zero coordinates (0-indexed from start).
into_origin_zero_placement placement explicit_track_count converts placement to origin-zero coordinates.
Line 0 is converted to Auto. Other line placements are converted using explicit_track_count to translate CSS grid coordinates to origin-zero coordinates.
Raises Failure if placement is Named_line or Named_span. Named lines must be resolved before calling this function.
compare a b provides a total ordering on placements.
Ordering: Auto < Line < Named_line < Span < Named_span. Within each variant, values are compared structurally.
pp fmt placement pretty-prints placement to fmt.
Operations on Geometry.Line.t containing grid placements. These work on pairs of start and end placements along a single axis.