-
Notifications
You must be signed in to change notification settings - Fork 0
/
callout.typ
63 lines (53 loc) · 949 Bytes
/
callout.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#import "configure.typ": configure
#let callout(
type: "note",
title: none,
icon: true,
width: 100%,
height: auto,
body
) = {
let (logo, box-color, title-color) = (
configure.at(type).logo,
configure.at(type).box-color,
configure.at(type).title-color
)
block(
width: width,
height: height,
fill: box-color,
inset: 8pt,
radius: 4pt,
stroke: (left: 0.2em+title-color)
)[
#if title != none {
if icon == true {
grid(
columns: 2,
column-gutter: 1.4em,
rows: 1,
place(
center+horizon,
dx: 0.5em,
image(logo, width: 1.3em),
),
text(
fill: title-color,
weight: "bold",
size: 1.3em
)[#title]
)} else {
grid(
columns: 1,
text(
fill: title-color,
weight: "bold",
size: 1.3em
)[#title]
)
}
}
#body
]
}
#callout[#lorem(50)]