package toffee

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.1.0.tbz
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9

doc/toffee.geometry/Geometry/Min_max/index.html

Module Geometry.Min_maxSource

Generic container for minimum and maximum constraint values.

A min-max pair represents a constraint range used throughout the layout engine for size bounds, such as min-width/max-width or min-height/max-height in CSS. The type parameters 'min and 'max allow for different types, enabling flexible constraint representations.

Sourcetype ('min, 'max) t = {
  1. min : 'min;
  2. max : 'max;
}

('min, 'max) t is a container holding a minimum value of type 'min and a maximum value of type 'max.

The separate type parameters allow for heterogeneous constraints, such as {min = Some 100.0; max = None} to represent a minimum bound without a maximum bound.

Creation

Sourceval make : 'min -> 'max -> ('min, 'max) t

make min max creates a min-max pair.

Transformations

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

map f min_max applies f to both the min and max values.

Sourceval map_min : ('min -> 'min) -> ('min, 'max) t -> ('min, 'max) t

map_min f min_max applies f to the min value only, preserving the max value unchanged.

Sourceval map_max : ('max -> 'max) -> ('min, 'max) t -> ('min, 'max) t

map_max f min_max applies f to the max value only, preserving the min value unchanged.