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