package bonsai

  1. Overview
  2. Docs
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.web_ui_view/theme.ml.html

Source file theme.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
25
26
27
28
29
open! Core
open! Import
module Constants = Constants
module Underlying = Underlying_intf

module type Impl_s = sig
  include Underlying.S

  val singleton : c
end

type t = (module Impl_s)

let override_constants (theme : t) ~(f : Constants.t -> Constants.t) : t =
  let module T = (val theme) in
  let prev_constants = T.singleton#constants in
  let new_constants = f prev_constants in
  (module struct
    class c =
      object
        inherit T.c
        method! constants = new_constants
      end

    let singleton = new c
  end)
;;

let name ((module T) : t) = T.singleton#theme_name
OCaml

Innovation. Community. Security.