Tailwind classes in OCaml
1(** State variants and pseudo-classes *)
2
3(** Variant modifier *)
4type t
5
6(** Pseudo-class states *)
7type pseudo = [
8 | `Hover
9 | `Focus
10 | `Focus_within
11 | `Focus_visible
12 | `Active
13 | `Visited
14 | `Target
15 | `Disabled
16 | `Enabled
17 | `Checked
18 | `Indeterminate
19 | `Default
20 | `Required
21 | `Valid
22 | `Invalid
23 | `In_range
24 | `Out_of_range
25 | `Placeholder_shown
26 | `Autofill
27 | `Read_only
28]
29
30(** Pseudo-element states *)
31type pseudo_element = [
32 | `Before
33 | `After
34 | `First_line
35 | `First_letter
36 | `Marker
37 | `Selection
38 | `File
39 | `Backdrop
40 | `Placeholder
41]
42
43(** Structural pseudo-classes *)
44type structural = [
45 | `First
46 | `Last
47 | `Only
48 | `Odd
49 | `Even
50 | `First_of_type
51 | `Last_of_type
52 | `Only_of_type
53 | `Empty
54 | `Root
55 | `Nth of int
56 | `Nth_last of int
57]
58
59(** Group and peer variants *)
60type group = [
61 | `Group of pseudo
62 | `Peer of pseudo
63]
64
65(** Special variants *)
66type special = [
67 | `Not of pseudo
68 | `Has of string
69 | `Where of string
70 | `Is of string
71 | `Starting_style
72 | `Inert
73 | `Open
74 | `In of string
75]
76
77(** Apply pseudo-class variant *)
78val pseudo : pseudo -> Css.t -> t
79
80(** Apply pseudo-element variant *)
81val pseudo_element : pseudo_element -> Css.t -> t
82
83(** Apply structural variant *)
84val structural : structural -> Css.t -> t
85
86(** Apply group variant *)
87val group : group -> Css.t -> t
88
89(** Apply special variant *)
90val special : special -> Css.t -> t
91
92(** Convert to CSS class *)
93val to_class : t -> Css.t
94
95(** Apply variant to classes *)
96val apply : t -> Css.t -> Css.t
97
98(** Common variants *)
99val hover : Css.t -> Css.t
100val focus : Css.t -> Css.t
101val active : Css.t -> Css.t
102val disabled : Css.t -> Css.t
103val first : Css.t -> Css.t
104val last : Css.t -> Css.t
105val odd : Css.t -> Css.t
106val even : Css.t -> Css.t
107val starting_style : Css.t -> Css.t