Tailwind classes in OCaml
1(** Size and spacing units *)
2
3(** Represents a size value in Tailwind *)
4type t = [ `Px (** 1px *)
5 | `Zero (** 0 *)
6 | `Auto (** auto *)
7 | `Rem of float (** Rem-based sizes: 0.5, 1.0, 1.5, etc. *)
8 | `Fraction of int * int (** Fractions: 1/2, 1/3, 2/3, etc. *)
9 | `Full (** 100% *)
10 | `Screen (** 100vw or 100vh *)
11 | `Min (** min-content *)
12 | `Max (** max-content *)
13 | `Fit (** fit-content *)
14 | `Viewport of [`W | `H] * [`S | `L | `D] (** Viewport units: svw, lvh, dvh, etc. *) ]
15
16(** Convert a size to its Tailwind class suffix *)
17val to_string : t -> string
18
19(** Common size values *)
20val px : t
21val zero : t
22val auto : t
23val full : t
24val screen : t
25
26(** Create a rem-based size *)
27val rem : float -> t
28
29(** Create a fraction size *)
30val fraction : int -> int -> t