Module Mosaic_mlx.GridSource
Grid layout constructors for defining tracks and placing items.
box ~display:Display.Grid
~grid_template_columns:[ Grid.length 20.; Grid.fr 1.; Grid.fr 1. ]
~grid_template_rows:[ Grid.length 3.; Grid.fr 1.; Grid.length 3. ]
~grid_row:(Grid.line_range 1 2) ~grid_column:(Grid.line_range 1 4)
[...]
Grid template components
Values for ~grid_template_columns and ~grid_template_rows.
Sourcetype template = Toffee.Style.grid_template_component A grid template component (single track or repeat clause).
fr n is a flexible track taking n fractional units of remaining space.
length n is a fixed-width track of n cells.
percent n is a percentage-width track (0.0 to 1.0 range).
auto is an auto-sized track.
Sourceval min_content : template min_content is a track sized to the minimum content width.
Sourceval max_content : template max_content is a track sized to the maximum content width.
Sourceval fit_content : Toffee.Style.Compact_length.t -> template fit_content limit is a track clamped between min-content and limit.
Sourceval minmax :
min:Toffee.Style.Compact_length.t ->
max:Toffee.Style.Compact_length.t ->
template minmax ~min ~max is a track that sizes between min and max.
Grid placement
Values for ~grid_row and ~grid_column.
Sourcetype placement = Toffee.Style.grid_placement A grid placement specification for a single axis endpoint.
line n places at grid line n (1-indexed, negative from end).
span n spans n tracks from the opposite endpoint.
auto_placement uses the auto-placement algorithm.
line_range s e is a placement from line s to line e. Shorthand for { start = line s; end_ = line e }.
span_range s n places starting at line s and spanning n tracks. Shorthand for { start = line s; end_ = span n }.
Track sizing functions
Values for ~grid_auto_rows and ~grid_auto_columns.
Sourcetype track = Toffee.Style.track_sizing_function A track sizing function for auto rows/columns.
track_fr n is a flexible track of n fractional units.
track_length n is a fixed-length track of n cells.
track_percent n is a percentage-width track (0.0 to 1.0 range).
track_auto is an auto-sized track.
Sourceval track_min_content : track track_min_content is a track sized to the minimum content width.
Sourceval track_max_content : track track_max_content is a track sized to the maximum content width.
Grid template areas
Sourcetype area = Toffee.Style.grid_template_area A named grid template area.