added basic warning box
This commit is contained in:
parent
3cc26cb85d
commit
db1fdf1f54
2 changed files with 33 additions and 0 deletions
32
lib/boxes.typ
Normal file
32
lib/boxes.typ
Normal 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
|
||||
})
|
||||
}
|
||||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue