Context: I’m working through bonsai/08-css.md at master · janestreet/bonsai · GitHub , which has 3 ways of using css. I can’t get the ppx_css one to work.
Here is my dune file:
(library
(name bc_bonsai_guide)
(preprocess
(pps ppx_jane ppx_css ppx_pattern_bind ppx_typed_fields js_of_ocaml-ppx))
(libraries
angstrom
async_kernel
bonsai
bonsai_web
bonsai_experimental_animation
bonsai_web_ui_form
bonsai_web_ui_query_box
bonsai_web_ui_search_bar
bonsai_web_ui_drag_and_drop
core_kernel
core_kernel.composition_infix
js_of_ocaml
virtual_dom
virtual_dom.keyboard
incr_dom
incr_dom_partial_render))
Here is my Ch_08.ml
open Core
open Bonsai_web
module Style =
[%css stylesheet
{|
table.politicians {
border-collapse: collapse;
border: 1px solid brown;
}
table.politicians td {
padding: 4px;
}
table.politicians thead {
text-align: cente;r
background: brown;
color: antiquewhite;
font-weight: bold;
}
table.politicians tr {
background: antiquewhite;
}
table.politicians tr:nth-child(even) {
background: wheat;
}
|}]
Here is the error I get:
File "ml/b_snips/bc_bonsai_guide/Ch_08.ml", line 6, characters 4-7:
6 | [%css stylesheet
^^^
Error: Uninterpreted extension 'css'.
debug 1
Based on bonsai/08-css.md at master · janestreet/bonsai · GitHub , I get the impression all we need is
+ (preprocess (pps (ppx_jane ppx_css)))
I definitely have both of those in my dunefile.
debug 2
I’m looking at ppx_css/web_test at master · janestreet/ppx_css · GitHub and I’m not seeing anything special they are doing in dune or *.ml