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
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue