This commit is contained in:
2025-07-26 02:05:39 +02:00
parent 36f475df48
commit aec0177c6f
3 changed files with 12 additions and 13 deletions

View File

@@ -183,9 +183,9 @@
else { fn(option) } else { fn(option) }
} }
#let stroke2css(stroke) = { #let stroke2css(stroke, default:"none") = {
if type(stroke) == dictionary { if type(stroke) == dictionary {
return "none" return default
} }
let th = len2css(stroke.thickness, default: "1pt") let th = len2css(stroke.thickness, default: "1pt")
return th + " solid black" // TODO: paint return th + " solid black" // TODO: paint
@@ -193,12 +193,11 @@
#let css-style(it) = { #let css-style(it) = {
return " return "
display: inline-block; " + option-map(stroke2css(it.stroke, default:none), "", x => "border:"+x+";") + "
border: "+stroke2css(it.stroke)+"; " + option-map(len2css(it.radius, default:none), "", x => "border-radius:"+x+";") + "
border-radius: "+len2css(it.radius, default: "0px")+";
" + option-map(len2css(it.width, default:none), "", x => "width:"+x+";") +" " + option-map(len2css(it.width, default:none), "", x => "width:"+x+";") +"
" + option-map(len2css(it.height, default:none), "", x => "height:"+x+";") +" " + option-map(len2css(it.height, default:none), "", x => "height:"+x+";") +"
padding: " + len2css(it.inset) " + option-map(len2css(it.inset, default:none), "", x => "padding:"+x+";")
} }
#let wimage(path, width:100%, alt:"image") = { #let wimage(path, width:100%, alt:"image") = {
@@ -249,7 +248,7 @@
// TODO: move to component // TODO: move to component
#let table-of-contents() = { #let table-of-contents() = {
html-style(class:"table-of-contents", "", box( html-style(class:"table-of-contents", "", block(
stroke: 1.2pt+black, stroke: 1.2pt+black,
radius: 2pt, radius: 2pt,
inset: 3%, inset: 3%,

View File

@@ -36,10 +36,10 @@
} else { } else {
if it.block { if it.block {
html-style-div("margin-top:4pt;", html-style-div("margin-top:4pt;",
block( box(
stroke: black, stroke: black,
radius: 2pt, radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt }, inset: if is-html() { 1.6pt } else { 5pt },
outset: 0pt, outset: 0pt,
it it
)) ))
@@ -47,7 +47,7 @@
box( box(
stroke: black, stroke: black,
radius: 2pt, radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt }, inset: if is-html() { 1.6pt } else { 5pt },
outset: 0pt, outset: 0pt,
baseline: 3.1pt, baseline: 3.1pt,
it it
@@ -57,7 +57,7 @@
#show box: it => { #show box: it => {
context if is-html() { context if is-html() {
html.elem("span", attrs: (style: css-style(it)))[#it.body] html.elem("span", attrs: (style: css-style(it)+"display:inline-block"))[#it.body]
} else { } else {
it it
} }

View File

@@ -44,8 +44,8 @@
]}], ]}],
[#context if min-pdf-link and is-html() [ [#context if min-pdf-link and is-html() [
Renderings of this page: Renderings of this page:
- #variant-link("Minimal PDF (printable)", ".min.pdf") - #variant-link("minimal PDF (printable)", ".min.pdf")
- #variant-link("less bloated HTML", ".min.html") // TODO: fix and re-add - #variant-link("less bloated HTML", ".min.html")
- #variant-link("minimal HTML", ".nano.html") - #variant-link("minimal HTML", ".nano.html")
]], ]],