Pill classes test

This commit is contained in:
Dandaedre 2026-09-02 23:11:23 +02:00
parent 49e0910d41
commit df091e498f
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
2 changed files with 51 additions and 1 deletions

View File

@ -95,6 +95,39 @@
}
//----- Keep the activity kind first and stabilize the remaining type tags -----
#let origin-pill(name) = {
let accent = theme-var("origin-colors").at(name)
box(
baseline: 0.5pt,
inset: (x: 3pt, y: 1pt),
radius: 2.5pt,
fill: accent.lighten(78%),
stroke: 0.55pt + accent,
)[
#text(size: 6.8pt, weight: "bold", fill: accent.darken(15%))[#name]
]
}
#let format-technique-tag(tag) = {
let origin = none
for name in theme-var("origin-colors").keys() {
if tag.contains("(" + name + ")") {
origin = name
}
}
if origin == none {
tag
} else {
let label = tag.replace("(" + origin + ")", "").trim()
if label == "" {
origin-pill(origin)
} else {
[#label #origin-pill(origin)]
}
}
}
#let format-technique-type(value) = {
let tags = value
.split(",")
@ -112,7 +145,7 @@
.filter(tag => not (tag in activity-tags))
.sorted(key: tag => lower(tag))
(activity-tags + other-tags).join(", ")
(activity-tags + other-tags).map(format-technique-tag).join([, ])
}
//----- Convert a TSV row into the table's five displayed cells -----

View File

@ -44,6 +44,23 @@
emphasis: rgb("#7A2424"),
link: rgb("#7A2424"),
//----- Origin pills -----
origin-colors: (
Abyssal: rgb("#51406F"),
Baloth: rgb("#8A4738"),
Béhémoth: rgb("#73523C"),
Célestial: rgb("#B07C28"),
Djieien: rgb("#765078"),
Dragon: rgb("#A43F32"),
Fenrir: rgb("#526A78"),
Guivre: rgb("#6C7040"),
Kraken: rgb("#32677A"),
Léviathan: rgb("#38756C"),
Röc: rgb("#9A6335"),
Tréant: rgb("#4F7047"),
Yénuï: rgb("#8A4964"),
),
//----- Heading and decorative symbols -----
heading-numbering: "1.",
section-symbol: "❖",