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

View File

@@ -36,10 +36,10 @@
} else {
if it.block {
html-style-div("margin-top:4pt;",
block(
box(
stroke: black,
radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt },
inset: if is-html() { 1.6pt } else { 5pt },
outset: 0pt,
it
))
@@ -47,7 +47,7 @@
box(
stroke: black,
radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt },
inset: if is-html() { 1.6pt } else { 5pt },
outset: 0pt,
baseline: 3.1pt,
it
@@ -57,7 +57,7 @@
#show box: it => {
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 {
it
}

View File

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