Tailwind classes in OCaml
1open Tailwind 2 3let test_transition () = 4 let trans = Effects.transition `All in 5 Alcotest.(check string) "transition all" "transition-all" (Css.to_string trans) 6 7let test_transition_colors () = 8 let trans = Effects.transition `Colors in 9 Alcotest.(check string) "transition colors" "transition-colors" (Css.to_string trans) 10 11let test_duration () = 12 let dur = Effects.duration 300 in 13 Alcotest.(check string) "duration 300ms" "duration-300" (Css.to_string dur) 14 15let test_ease () = 16 let ease_in = Effects.ease `In in 17 Alcotest.(check string) "ease in" "ease-in" (Css.to_string ease_in); 18 19 let ease_out = Effects.ease `Out in 20 Alcotest.(check string) "ease out" "ease-out" (Css.to_string ease_out) 21 22let test_shadow () = 23 let shadow = Effects.shadow_md in 24 Alcotest.(check string) "shadow medium" "shadow-md" (Css.to_string shadow) 25 26let test_rounded () = 27 let rounded = Effects.rounded_lg in 28 Alcotest.(check string) "rounded large" "rounded-lg" (Css.to_string rounded) 29 30let test_border () = 31 let border = Effects.border in 32 Alcotest.(check string) "basic border" "border" (Css.to_string border) 33 34(* Additional duration tests *) 35let test_duration_edge_cases () = 36 let zero = Effects.duration 0 in 37 let large = Effects.duration 9999 in 38 Alcotest.(check string) "zero duration" "duration-0" (Css.to_string zero); 39 Alcotest.(check string) "large duration" "duration-9999" (Css.to_string large) 40 41let suite = [ 42 "transition", `Quick, test_transition; 43 "transition_colors", `Quick, test_transition_colors; 44 "duration", `Quick, test_duration; 45 "ease", `Quick, test_ease; 46 "shadow", `Quick, test_shadow; 47 "rounded", `Quick, test_rounded; 48 "border", `Quick, test_border; 49 "duration_edge_cases", `Quick, test_duration_edge_cases; 50]