Tailwind classes in OCaml
1;; Examples demonstrating GADT-based Tailwind interface
2(executables
3 (public_names
4 index
5 hello_tailwind
6 colors_and_typography
7 layout_and_spacing
8 responsive_design
9 effects_and_variants
10 patterns_and_components
11 comprehensive_showcase
12 button_demo)
13 (names
14 index_00
15 hello_tailwind_01
16 colors_and_typography_02
17 layout_and_spacing_03
18 responsive_design_04
19 effects_and_variants_05
20 patterns_and_components_06
21 comprehensive_showcase_07
22 button_demo)
23 (package tailwind)
24 (libraries tailwind tailwind-html htmlit unix))
25
26;; HTML index generator
27(executable
28 (public_name index_html_generator)
29 (name index_html_generator)
30 (package tailwind)
31 (libraries tailwind tailwind-html htmlit))
32
33;; Generate HTML files from examples
34(rule
35 (target hello_tailwind_01.html)
36 (deps (:exe hello_tailwind_01.exe))
37 (action (with-stdout-to %{target} (run %{exe}))))
38
39(rule
40 (target colors_and_typography_02.html)
41 (deps (:exe colors_and_typography_02.exe))
42 (action (with-stdout-to %{target} (run %{exe}))))
43
44(rule
45 (target layout_and_spacing_03.html)
46 (deps (:exe layout_and_spacing_03.exe))
47 (action (with-stdout-to %{target} (run %{exe}))))
48
49(rule
50 (target responsive_design_04.html)
51 (deps (:exe responsive_design_04.exe))
52 (action (with-stdout-to %{target} (run %{exe}))))
53
54(rule
55 (target effects_and_variants_05.html)
56 (deps (:exe effects_and_variants_05.exe))
57 (action (with-stdout-to %{target} (run %{exe}))))
58
59(rule
60 (target patterns_and_components_06.html)
61 (deps (:exe patterns_and_components_06.exe))
62 (action (with-stdout-to %{target} (run %{exe}))))
63
64(rule
65 (target comprehensive_showcase_07.html)
66 (deps (:exe comprehensive_showcase_07.exe))
67 (action (with-stdout-to %{target} (run %{exe}))))
68
69(rule
70 (target button_demo.html)
71 (deps (:exe button_demo.exe))
72 (action (with-stdout-to %{target} (run %{exe}))))
73
74;; Generate CSS files using Tailwind CLI
75(rule
76 (targets hello_tailwind_01.css)
77 (deps
78 input.css
79 hello_tailwind_01.html)
80 (action
81 (run tailwindcss --input input.css --output %{targets} --minify)))
82
83(rule
84 (targets colors_and_typography_02.css)
85 (deps
86 input.css
87 colors_and_typography_02.html)
88 (action
89 (run tailwindcss --input input.css --output %{targets} --minify)))
90
91(rule
92 (targets layout_and_spacing_03.css)
93 (deps
94 input.css
95 layout_and_spacing_03.html)
96 (action
97 (run tailwindcss --input input.css --output %{targets} --minify)))
98
99(rule
100 (targets responsive_design_04.css)
101 (deps
102 input.css
103 responsive_design_04.html)
104 (action
105 (run tailwindcss --input input.css --output %{targets} --minify)))
106
107(rule
108 (targets effects_and_variants_05.css)
109 (deps
110 input.css
111 effects_and_variants_05.html)
112 (action
113 (run tailwindcss --input input.css --output %{targets} --minify)))
114
115(rule
116 (targets patterns_and_components_06.css)
117 (deps
118 input.css
119 patterns_and_components_06.html)
120 (action
121 (run tailwindcss --input input.css --output %{targets} --minify)))
122
123(rule
124 (targets comprehensive_showcase_07.css)
125 (deps
126 input.css
127 comprehensive_showcase_07.html)
128 (action
129 (run tailwindcss --input input.css --output %{targets} --minify)))
130
131(rule
132 (targets button_demo.css)
133 (deps
134 input.css
135 button_demo.html)
136 (action
137 (run tailwindcss --input input.css --output %{targets} --minify)))
138
139;; Generate index.html page
140(rule
141 (target index.html)
142 (deps (:exe index_html_generator.exe))
143 (action (with-stdout-to %{target} (run %{exe}))))
144
145;; Alias to build all HTML files
146(alias
147 (name examples-html)
148 (deps
149 index.html
150 hello_tailwind_01.html
151 colors_and_typography_02.html
152 layout_and_spacing_03.html
153 responsive_design_04.html
154 effects_and_variants_05.html
155 patterns_and_components_06.html
156 comprehensive_showcase_07.html
157 button_demo.html))
158
159;; Alias to build all CSS files (requires Tailwind CLI)
160(alias
161 (name examples-css)
162 (deps
163 (alias_rec examples-html)
164 hello_tailwind_01.css
165 colors_and_typography_02.css
166 layout_and_spacing_03.css
167 responsive_design_04.css
168 effects_and_variants_05.css
169 patterns_and_components_06.css
170 comprehensive_showcase_07.css
171 button_demo.css))
172
173;; Install generated files
174(install
175 (section doc)
176 (package tailwind)
177 (files
178 (index.html as examples/index.html)
179 (hello_tailwind_01.html as examples/hello_tailwind_01.html)
180 (hello_tailwind_01.css as examples/hello_tailwind_01.css)
181 (colors_and_typography_02.html as examples/colors_and_typography_02.html)
182 (colors_and_typography_02.css as examples/colors_and_typography_02.css)
183 (layout_and_spacing_03.html as examples/layout_and_spacing_03.html)
184 (layout_and_spacing_03.css as examples/layout_and_spacing_03.css)
185 (responsive_design_04.html as examples/responsive_design_04.html)
186 (responsive_design_04.css as examples/responsive_design_04.css)
187 (effects_and_variants_05.html as examples/effects_and_variants_05.html)
188 (effects_and_variants_05.css as examples/effects_and_variants_05.css)
189 (patterns_and_components_06.html as examples/patterns_and_components_06.html)
190 (patterns_and_components_06.css as examples/patterns_and_components_06.css)
191 (comprehensive_showcase_07.html as examples/comprehensive_showcase_07.html)
192 (comprehensive_showcase_07.css as examples/comprehensive_showcase_07.css)
193 (button_demo.html as examples/button_demo.html)
194 (button_demo.css as examples/button_demo.css)))