Skip to content

Commit 76f8a06

Browse files
Update template, add readme docs
1 parent eb3f254 commit 76f8a06

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

jscomp/bsb/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@ When adding/editing a template the script needs to be rerun to update the releva
1515
```sh
1616
opam install ocp-ocamlres
1717
```
18+
19+
## Testing a template locally
20+
21+
Do the following setup steps to build the compiler: [build ocaml compiler](https://github.com/BuckleScript/bucklescript/blob/master/CONTRIBUTING.md#build-the-vendored-ocaml-compiler) and [build everything in dev mode](https://github.com/BuckleScript/bucklescript/blob/master/CONTRIBUTING.md#build-everything-in-dev-mode-using-vendored-compiler).
22+
23+
The built binaries will end up under `lib` where you can run local `bsb`:
24+
25+
```sh
26+
./bsb -init test-theme -theme new_theme
27+
```

jscomp/bsb/bsb_templates.ml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,15 +1005,17 @@ let root = OCamlRes.Res.([
10051005
File ("index.css",
10061006
"body {\n\
10071007
\ margin: 0;\n\
1008-
\ font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n\
1009-
\ \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n\
1010-
\ sans-serif;\n\
1011-
\ -webkit-font-smoothing: antialiased;\n\
1012-
\ -moz-osx-font-smoothing: grayscale;\n\
1008+
\ font-family: -apple-system, system-ui, \"Segoe UI\", Helvetica, Arial,\n\
1009+
\ sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n\
10131010
}\n\
10141011
\n\
10151012
main {\n\
10161013
\ padding: 20px;\n\
1014+
}\n\
1015+
\n\
1016+
.counter {\n\
1017+
\ padding: 20px;\n\
1018+
\ display: inline-block;\n\
10171019
}\n\
10181020
") ;
10191021
File ("App.re",
@@ -1041,7 +1043,9 @@ let root = OCamlRes.Res.([
10411043
\ <button onClick={_ => dispatch(Decrement)}>\n\
10421044
\ {React.string(\"Decrement\")}\n\
10431045
\ </button>\n\
1044-
\ <span> {state.count |> string_of_int |> React.string} </span>\n\
1046+
\ <span className=\"counter\">\n\
1047+
\ {state.count |> string_of_int |> React.string}\n\
1048+
\ </span>\n\
10451049
\ <button onClick={_ => dispatch(Increment)}>\n\
10461050
\ {React.string(\"Increment\")}\n\
10471051
\ </button>\n\

0 commit comments

Comments
 (0)