package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/src/bonsai.kado/devbar.ml.html
Source file devbar.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
open! Core open! Import module Style = Devbar_style let make constants ~is_dark ~attrs ~count ~intent text = let colors = Option.map intent ~f:(View.Constants.Intent.lookup constants.intent) in let colors = match colors with | None -> Vdom.Attr.empty | Some { Fg_bg.foreground; background } -> Style.Variables.set ~fst:(Css_gen.Color.to_string_css foreground) ~snd:(Css_gen.Color.to_string_css background) () in let rep = List.init count ~f:(fun _ -> Vdom.Node.span [ Vdom.Node.text text ]) in Vdom.Node.div ~attrs: (attrs @ [ Style.devbar; colors; (if is_dark then Style.dark else Vdom.Attr.empty) ]) [ Vdom.Node.div ~attrs:[ Style.container ] (Vdom.Node.div ~attrs:[ Style.background ] [] :: rep) ] ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>