package toffee

Build not yet checked
  1. Overview
  2. Docs
CSS layout engine for OCaml (Flexbox, Grid, Block)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.3.0.tbz
sha256=a92cbbcbe016fb19fb0a749222da0e459a9567aef3f4c7340d9bd6b71c53ed6f
sha512=6a7ab054605538bb31a2b73a1a6d093981a2704c9f0af5852221c05735290d74aca7c7282298c4d0f91e86a800e2ccd94b4918af883cd963449c758eb6b272b3

doc/toffee.geometry/Toffee_geometry/In_both_abs_axis/index.html

Module Toffee_geometry.In_both_abs_axisSource

Container that holds an item in each absolute axis.

This module provides a simple two-field record for storing values that vary by absolute axis (horizontal and vertical). It is primarily used in CSS Grid layout for properties like track counts, gaps, and placements that differ by axis.

Sourcetype 'a t = {
  1. horizontal : 'a;
  2. vertical : 'a;
}

The type of a container holding a value for each absolute axis.

Sourceval make : horizontal:'a -> vertical:'a -> 'a t

make ~horizontal ~vertical creates a container.

Sourceval get : 'a t -> Absolute_axis.t -> 'a

get t axis returns the value for the specified axis.

Sourceval map : ('a -> 'b) -> 'a t -> 'b t

map f t applies f to both values.

Sourceval map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f t1 t2 applies f to corresponding axis values.

Sourceval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal eq t1 t2 tests equality using eq on both axes.

Sourceval compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare cmp t1 t2 compares using cmp with lexicographic ordering.

Compares horizontal values first; if equal, compares vertical values.

Sourceval to_string : ('a -> string) -> 'a t -> string

to_string f t converts to a string using f for values.

Sourceval pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit

pp f fmt t pretty-prints t using f for values.