ravenous_typst/setup/analysis/report_style.typ

49 lines
1.2 KiB
Plaintext

// Shared Steingrund presentation primitives for standalone analysis reports.
#import "../theme/themes.typ": make-theme
#let report-theme = make-theme(theme-name: "steingrund")
#let chart-theme = (
palette: (
report-theme.chart-1,
report-theme.chart-2,
report-theme.chart-3,
report-theme.chart-4,
),
text-color: report-theme.ink,
text-color-light: report-theme.muted-ink,
axis-stroke: 0.65pt + report-theme.dark-gold,
grid-stroke: 0.5pt + report-theme.dark-gold.transparentize(55%),
marker-stroke: 0.5pt + report-theme.parchment-light,
background: none,
border: none,
show-grid: true,
legend-position: "bottom",
base-size: 7pt,
base-gap: 5pt,
)
#let rounded(value, digits: 2) = if value == none {
[—]
} else {
str(calc.round(value, digits: digits))
}
#let metric-card(label, value, note: none) = block(
width: 100%,
fill: report-theme.parchment,
stroke: 0.6pt + report-theme.border,
inset: 9pt,
radius: 2pt,
)[
#text(size: 7pt, tracking: 0.08em, weight: "bold", fill: report-theme.heading-subtle)[
#upper(label)
]
#text(size: 18pt, weight: "bold", fill: report-theme.heading)[#value]
#if note != none {
text(size: 7.5pt, fill: report-theme.muted-ink)[#note]
}
]