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(** Pseudo-element states *)
30type pseudo_element =
31 | Before
32 | After
33 | First_line
34 | First_letter
35 | Marker
36 | Selection
37 | File
38 | Backdrop
39 | Placeholder
40
41(** Structural pseudo-classes *)
42type structural =
43 | First
44 | Last
45 | Only
46 | Odd
47 | Even
48 | First_of_type
49 | Last_of_type
50 | Only_of_type
51 | Empty
52 | Root
53 | Nth of int
54 | Nth_last of int
55
56(** Group and peer variants *)
57type group =
58 | Group of pseudo
59 | Peer of pseudo
60
61(** Special variants *)
62type special =
63 | Not of pseudo
64 | Has of string
65 | Where of string
66 | Is of string
67 | Starting_style
68 | Inert
69 | Open
70 | In of string
71
72(** Apply pseudo-class variant *)
73val pseudo : pseudo -> Css.t -> t
74
75(** Apply pseudo-element variant *)
76val pseudo_element : pseudo_element -> Css.t -> t
77
78(** Apply structural variant *)
79val structural : structural -> Css.t -> t
80
81(** Apply group variant *)
82val group : group -> Css.t -> t
83
84(** Apply special variant *)
85val special : special -> Css.t -> t
86
87(** Convert to CSS class *)
88val to_class : t -> Css.t
89
90(** Apply variant to classes *)
91val apply : t -> Css.t -> Css.t
92
93(** Common variants *)
94val hover : Css.t -> Css.t
95val focus : Css.t -> Css.t
96val active : Css.t -> Css.t
97val disabled : Css.t -> Css.t
98val first : Css.t -> Css.t
99val last : Css.t -> Css.t
100val odd : Css.t -> Css.t
101val even : Css.t -> Css.t