package toffee

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

Module Style.Grid_template_areaSource

CSS grid template areas.

A grid template area defines a named rectangular region in a CSS grid. Named areas allow grid items to be positioned using semantic identifiers rather than numeric line indices. Multiple grid items can reference the same area name.

See MDN: grid-template-areas.

Sourcetype t = {
  1. name : string;
    (*

    The name identifying this grid area. Area names must match across all rows they span to form a valid rectangular region.

    *)
  2. row_start : int;
    (*

    The starting row line index in grid coordinates. Uses 1-based indexing.

    *)
  3. row_end : int;
    (*

    The ending row line index in grid coordinates. Exclusive bound using 1-based indexing.

    *)
  4. column_start : int;
    (*

    The starting column line index in grid coordinates. Uses 1-based indexing.

    *)
  5. column_end : int;
    (*

    The ending column line index in grid coordinates. Exclusive bound using 1-based indexing.

    *)
}

A named grid area.

Invariant: row_start < row_end and column_start < column_end for valid rectangular regions.

Constructors

Sourceval make : name:string -> row_start:int -> row_end:int -> column_start:int -> column_end:int -> t

make ~name ~row_start ~row_end ~column_start ~column_end creates a grid area.

Coordinates use 1-based indexing. The row_end and column_end values are exclusive bounds.

Precondition: row_start < row_end and column_start < column_end. This is not validated; invalid coordinates may cause incorrect layout behavior.

Accessors

Sourceval name : t -> string

name t returns the area's name identifier.

Sourceval row_start : t -> int

row_start t returns the starting row line index.

Sourceval row_end : t -> int

row_end t returns the ending row line index.

Sourceval column_start : t -> int

column_start t returns the starting column line index.

Sourceval column_end : t -> int

column_end t returns the ending column line index.

Comparison

Sourceval equal : t -> t -> bool

equal a b tests structural equality of grid areas.

Two areas are equal if all their fields match.

Sourceval compare : t -> t -> int

compare a b provides total ordering of grid areas.

Comparison proceeds lexicographically: name, then row_start, then row_end, then column_start, then column_end.