added basic warning box

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-07-24 23:43:45 +02:00
parent 3cc26cb85d
commit db1fdf1f54
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
2 changed files with 33 additions and 0 deletions

32
lib/boxes.typ Normal file
View file

@ -0,0 +1,32 @@
#let tag-warning-box = html.elem.with("warning-box")
#let warning-box(
title: [⚠️ Warning],
color: "red",
body
) = {
```raw-css
warning-box {
display: block;
border-left: .5em solid;
padding: 1em;
margin: 0.5em;
h4 {
margin-top: 0;
font-weight: bold;
}
}
```
tag-warning-box(
attrs: (style: "border-left-color: " + color + ";"),
{
if title != none {
html.h4(
style: "color: " + color + ";", title
);
}
body
})
}

View file

@ -4,6 +4,7 @@
#import "./summary.typ": summary, card-list
#import "./states.typ": current-page-label, state-page-summaries
#import "./pyscript.typ": state-use-pyscript, state-pyscript-data-list, state-pyscript-version, state-pyscript-interpreters, state-pyscript-default-interpreter, pyscript-show, pyscript-data
#import "boxes.typ": *
#import "./rss.typ": rss
#import "./icons.typ"