add theme picker
This commit is contained in:
parent
a4337b3514
commit
49f457cda7
5 changed files with 122 additions and 21 deletions
|
|
@ -1,4 +1,16 @@
|
|||
#let css-list = state("css-list", ())
|
||||
|
||||
/// Add string `css` to `css-list` if not already present
|
||||
#let add-css(css) = context {
|
||||
css-list.update(x => if css in x { x } else { x + (css,) })
|
||||
}
|
||||
|
||||
/// Concatenate all css found in css-list at the end of the document
|
||||
#let get-css() = context {
|
||||
css-list.final().join("\n\n")
|
||||
}
|
||||
|
||||
#let html_show(body) = {
|
||||
show raw.where(lang: "raw-css"): it => html.style(it.text)
|
||||
show raw.where(lang: "raw-css"): it => add-css(it.text)
|
||||
body
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue