NixLabConnectionconnecting
ProjectsProject
web /

dreamstop.openfp.net

publicguest

dreamstop.openfp.net, the website and user manual of dreamstop, a language for continuous disambiguation

git clone git@nixlab.openfp.net:web/dreamstop.openfp.net.git
19f5b440f892495e9417f13eefeecef62e883230manual/style.typ
#import "theme.typ": tokens
#import "codepoints.typ": codepoints, layers

// dreamstop's brand colour, in the shades the design kit's brands use.
// The owner has yet to choose it. Change `accent` to pick another.
#let accents = (
  zinc: (a300: rgb("#d4d4d8"), a400: rgb("#a1a1aa"), a500: rgb("#71717a"), a600: rgb("#52525b")),
  violet: (a300: rgb("#c4b5fd"), a400: rgb("#a78bfa"), a500: rgb("#8b5cf6"), a600: rgb("#7c3aed")),
  indigo: (a300: rgb("#a5b4fc"), a400: rgb("#818cf8"), a500: rgb("#6366f1"), a600: rgb("#4f46e5")),
  fuchsia: (a300: rgb("#f0abfc"), a400: rgb("#e879f9"), a500: rgb("#d946ef"), a600: rgb("#c026d3")),
)
#let accent = accents.zinc

// The layer colours are chosen for the site's light surfaces, so every
// annotation sits on the site's zinc-100 panel, where each colour reaches
// WCAG AA.
#let chip-fill = rgb("#f4f4f5")
#let chip-ink = rgb("#27272a")

// An annotation, coloured by layer.
#let a(s) = box(
  fill: chip-fill,
  inset: (x: 3pt, y: 0pt),
  outset: (y: 2.5pt),
  radius: 2pt,
  codepoints(text(font: "DejaVu Sans Mono", size: 8pt, fill: chip-ink, s)),
)

// An example sentence, set off as the handbook sets its entries.
#let entry(body) = block(
  inset: (left: 1.2em, y: 0.2em),
  stroke: (left: 2pt + accent.a500),
  text(style: "italic", fill: tokens.title, body),
)

// The readings of a sentence: pairs of an annotation and a gloss.
#let readings(..rs) = enum(
  numbering: "1.",
  ..rs.pos().map(r => [#a(r.at(0)) #h(0.3em) #r.at(1)]),
)

// A table of rewrites, each with its annotation.
#let rewrites(..rows) = table(
  columns: (auto, 1fr),
  table.header([*Annotation*], [*Rewrite*]),
  ..rows.pos().map(r => (a(r.at(0)), r.at(1))).flatten(),
)

// Where an example comes from.
#let source(body) = block(above: 0.6em, text(size: 8.5pt, fill: tokens.muted)[#body])

// The two sides of a pair, for limit pairs, whose bad side is not rewritten
// away.
#let sides(bad, good) = table(
  columns: (auto, auto, 1fr),
  table.header([*Side*], [*Annotation*], [*Sentence*]),
  [Bad], a(bad.at(0)), bad.at(1),
  [Good], a(good.at(0)), good.at(1),
)

// The caption of a kind's pattern file.
#let patterns(kind) = text(size: 8.5pt, fill: tokens.muted)[#raw("allowed.vx") of #raw("dreamstop/kinds/" + kind) at 0.1.0.0]