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/src/toffee.geometry/in_both_abs_axis.ml.html

Source file in_both_abs_axis.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
type 'a t = { horizontal : 'a; vertical : 'a }

let make ~horizontal ~vertical = { horizontal; vertical }

let get t axis =
  match axis with
  | Absolute_axis.Horizontal -> t.horizontal
  | Absolute_axis.Vertical -> t.vertical

let map f t = { horizontal = f t.horizontal; vertical = f t.vertical }

let map2 f t1 t2 =
  {
    horizontal = f t1.horizontal t2.horizontal;
    vertical = f t1.vertical t2.vertical;
  }

let equal eq t1 t2 =
  eq t1.horizontal t2.horizontal && eq t1.vertical t2.vertical

let compare cmp t1 t2 =
  match cmp t1.horizontal t2.horizontal with
  | 0 -> cmp t1.vertical t2.vertical
  | c -> c

let to_string f t =
  Printf.sprintf "{ horizontal = %s; vertical = %s }" (f t.horizontal)
    (f t.vertical)

let pp f fmt t =
  Format.fprintf fmt "{ horizontal = %a; vertical = %a }" f t.horizontal f
    t.vertical