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.tree/Toffee_tree/Requested_axis/index.html

Module Toffee_tree.Requested_axisSource

Axis that layout algorithms can be requested to compute a size for.

Requested_axis specifies which dimensions a layout algorithm should compute. Unlike Toffee_geometry.Absolute_axis, which represents only horizontal or vertical axes, Requested_axis includes a Both variant to indicate that both dimensions should be computed simultaneously.

This type is used in Layout_input.t to control which axis or axes a node should compute during layout. Single-axis requests are used when querying intrinsic sizes, while Both is used for full layout passes.

Sourcetype t =
  1. | Horizontal
    (*

    Compute the horizontal axis.

    *)
  2. | Vertical
    (*

    Compute the vertical axis.

    *)
  3. | Both
    (*

    Compute both axes simultaneously.

    *)

The type representing which axis or axes to compute.

Conversion Functions

Sourceval of_absolute_axis : Toffee_geometry.Absolute_axis.t -> t

of_absolute_axis axis converts an absolute axis to a requested axis.

Maps Horizontal to Horizontal and Vertical to Vertical.

Sourceval to_absolute_axis : t -> Toffee_geometry.Absolute_axis.t option

to_absolute_axis t converts a requested axis to an absolute axis.

Returns Some Horizontal or Some Vertical for single-axis requests, and None for Both.

String Conversion

Sourceval to_string : t -> string

to_string t returns a string representation of the requested axis.

Returns "Horizontal", "Vertical", or "Both".

Comparison and Equality

Sourceval compare : t -> t -> int

compare a b compares two requested axes.

The ordering is Horizontal < Vertical < Both.

Sourceval equal : t -> t -> bool

equal a b tests equality of two requested axes.

Sourceval pp : Format.formatter -> t -> unit

pp fmt t pretty-prints a requested axis to a formatter.