ravenous_typst/setup/theme/boxes.typ

112 lines
2.8 KiB
Plaintext

#import "../core/macros.typ": memo_box
#import "decorations.typ" as spacers
#import "variables.typ": resolve-table-theme, theme
#let ravhelp = memo_box
#let ravex(content) = ravhelp(title: "Par exemple", content)
#let ravtwoex(ex1, ex2) = ravhelp(
title: "Par exemple",
[#ex1 #spacers.fantasy-label("MÉCANIQUE EXCLUSIVE", theme-name: "warm") #ex2],
)
#let ravbox(args) = ravhelp(args, title: none)
// A quiet inline example for dense rules sections where a full memo box would
// compete too strongly with the surrounding text.
#let stealthy-example(
content,
title: [Exemple],
) = pad(left: 1.05em, right: 0.2em)[
#block(
width: 100%,
breakable: false,
inset: (left: 1.15em, right: 0.25em, y: 0.28em),
stroke: (left: 0.7pt + theme.muted.lighten(42%).transparentize(25%)),
)[
#text(
size: 7pt,
weight: "semibold",
tracking: 0.035em,
fill: theme.muted.transparentize(18%),
upper(title),
)
#h(0.5em)#emph(text(size: 0.9em, fill: theme.ink.transparentize(20%))[#content])
]
]
// Optional rules that add tactical nuance but are not required on a first read.
// The fixed Steingrund palette keeps this signal consistent across book themes.
#let ravadvanced(
content,
title: [Notion avancée],
) = {
let t = resolve-table-theme("steingrund")
block(
width: 100%,
breakable: false,
inset: (left: 12pt, right: 9pt, y: 8pt),
radius: (right: 3pt),
fill: t.parchment-accent.transparentize(25%),
stroke: (
left: 2.6pt + t.attack-mixed,
top: 0.35pt + t.border,
right: 0.35pt + t.border,
bottom: 0.35pt + t.border,
),
)[
#text(
size: 7.2pt,
weight: "semibold",
tracking: 0.045em,
fill: t.attack-mixed,
)[NOTION AVANCÉE]
#v(0.35em)
#text(weight: "bold", fill: t.heading)[#title]
#v(0.45em)
#content
]
}
#let inline_help(content) = {
emph[( #content )]
}
// Marks deliberately incomplete content in player-facing documents.
// Keep the pill available for compact indexes and headings, even where the
// complete admonition is more appropriate.
#let temporary-section-pill(label: "Section provisoire") = box(
inset: (x: 0.55em, y: 0.18em),
radius: 999pt,
fill: theme.dark-gold.lighten(82%),
stroke: 0.45pt + theme.dark-gold.lighten(38%),
text(
size: 7pt,
weight: "semibold",
tracking: 0.03em,
fill: theme.dark-gold.darken(12%),
upper(label),
),
)
#let temporary-section(
content,
title: [Contenu temporaire],
) = block(
width: 100%,
breakable: false,
inset: 12pt,
radius: 4pt,
fill: theme.parchment,
stroke: (left: 2.4pt + theme.dark-gold, rest: 0.55pt + theme.gold),
)[
#text(
size: 7.5pt,
weight: "semibold",
tracking: 0.04em,
fill: theme.dark-gold.darken(12%),
)[SECTION PROVISOIRE]
#h(0.6em)
#strong[#title]
#v(0.55em)
#content
]