Extension 2.10.0, study field, German "Abschnitt" for sections; rebuild
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f047b9c7ae
commit
d74a2e90b4
88 files changed
+874
-437
No files matched your search
@@ -0,0 +1,115 @@
|
||||
/* calc-notes — HTML layout for the calc / calc* environments */
|
||||
|
||||
.calc {
|
||||
display: grid;
|
||||
/* lhs | rhs | notes | equation number */
|
||||
grid-template-columns: max-content max-content minmax(8rem, 1fr) auto;
|
||||
column-gap: 0.35rem;
|
||||
row-gap: 0.6rem;
|
||||
align-items: baseline;
|
||||
margin: 1rem 0 1.4rem;
|
||||
/* allow horizontal scrolling for very wide equations, but never show a
|
||||
vertical bar (Firefox computes phantom vertical overflow otherwise) */
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
padding-bottom: 0.4em; /* keep descenders clear of a horizontal bar */
|
||||
}
|
||||
|
||||
.calc-row { display: contents; }
|
||||
|
||||
.calc-lhs { grid-column: 1; justify-self: end; }
|
||||
.calc-rhs { grid-column: 2; justify-self: start; }
|
||||
.calc-full { grid-column: 1 / 3; justify-self: start; }
|
||||
|
||||
/* ---- notes ------------------------------------------------------- */
|
||||
|
||||
.calc-notes {
|
||||
grid-column: 3;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem 0.75rem;
|
||||
align-items: baseline;
|
||||
min-width: 0;
|
||||
padding-left: 0.9rem;
|
||||
}
|
||||
|
||||
.calc-note {
|
||||
color: var(--calc-notecolor, #B45309);
|
||||
font-size: 0.85em;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.calc-note > summary {
|
||||
cursor: pointer;
|
||||
list-style: none; /* remove the default triangle ... */
|
||||
user-select: none;
|
||||
font-style: italic; /* quiet by style and --calc-muted (theme.css), not by
|
||||
opacity, which took it under 4.5:1 */
|
||||
}
|
||||
.calc-note > summary::-webkit-details-marker { display: none; }
|
||||
.calc-note > summary::before { content: "▸ "; font-style: normal; }
|
||||
.calc-note[open] > summary::before { content: "▾ "; }
|
||||
.calc-note > summary:hover { opacity: 1; }
|
||||
|
||||
.calc-note[open] {
|
||||
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 8%, transparent);
|
||||
border-left: 2px solid var(--calc-notecolor, #B45309);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.15rem 0.45rem;
|
||||
}
|
||||
|
||||
.calc-note-body { margin-top: 0.1rem; }
|
||||
.calc-note-body p { margin: 0; }
|
||||
|
||||
/* \mnote: math note (no extra styling needed — body is typeset math) */
|
||||
.calc-note-math .calc-note-body { padding: 0.1rem 0; }
|
||||
|
||||
/* ---- calc*: boxed final result ----------------------------------- */
|
||||
|
||||
.calc-box {
|
||||
display: inline-block;
|
||||
border: 1.5px solid currentColor;
|
||||
border-radius: 0.3em;
|
||||
padding: 0.3em 0.65em;
|
||||
margin-top: 0.15em;
|
||||
background: color-mix(in srgb, currentColor 4%, transparent);
|
||||
}
|
||||
|
||||
/* ---- labelled blocks: equation number on the last line ----------- */
|
||||
|
||||
.calc-tag {
|
||||
grid-column: 4;
|
||||
justify-self: end;
|
||||
padding-left: 1rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---- printing: show notes unfolded, like the PDF ------------------ */
|
||||
|
||||
@media print {
|
||||
.calc-note > summary { display: none; }
|
||||
.calc-note[open] { background: none; border: none; padding: 0; }
|
||||
}
|
||||
|
||||
/* small screens: notes drop under the equation line */
|
||||
@media (max-width: 560px) {
|
||||
.calc { grid-template-columns: max-content 1fr; }
|
||||
.calc-notes { grid-column: 1 / 3; padding-left: 1.5rem; }
|
||||
.calc-full { grid-column: 1 / 3; }
|
||||
.calc-tag { grid-column: 1 / -1; }
|
||||
}
|
||||
|
||||
/* --- interactive figures ------------------------------------------------
|
||||
A figure that is dragged — a rotatable 3d view, a point moved with the
|
||||
mouse — must not select its own labels while the pointer travels over
|
||||
them: the browser would paint the axis names and captions as selected
|
||||
text. The readouts and captions around the drawing stay selectable, so a
|
||||
value can still be copied. The hooks are the ones every course's figure
|
||||
scripts build into. */
|
||||
[data-notes-fig] svg,
|
||||
[data-notes-plot] svg,
|
||||
[data-notes-fig] canvas,
|
||||
[data-notes-plot] canvas {
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// calc-notes — open every note before printing, restore afterwards
|
||||
(function () {
|
||||
window.addEventListener("beforeprint", function () {
|
||||
document.querySelectorAll("details.calc-note").forEach(function (d) {
|
||||
d.dataset.calcWasOpen = d.open ? "1" : "0";
|
||||
d.open = true;
|
||||
});
|
||||
});
|
||||
window.addEventListener("afterprint", function () {
|
||||
document.querySelectorAll("details.calc-note").forEach(function (d) {
|
||||
d.open = d.dataset.calcWasOpen === "1";
|
||||
delete d.dataset.calcWasOpen;
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
// --- high contrast: a switch of its own, beside Quarto's light/dark one ----
|
||||
// The class is already set before the first paint by the script calc-notes.lua
|
||||
// puts in the head; this only builds the control and remembers a choice.
|
||||
// Precedence: what the reader picked here, then `high-contrast: true` in the
|
||||
// book, then the reader's system setting.
|
||||
(function () {
|
||||
var KEY = "notes-contrast";
|
||||
var root = document.documentElement;
|
||||
|
||||
var LABELS = {
|
||||
de: { on: "Hoher Kontrast aus", off: "Hoher Kontrast ein" },
|
||||
fr: { on: "Désactiver le contraste élevé", off: "Activer le contraste élevé" },
|
||||
en: { on: "Turn high contrast off", off: "Turn high contrast on" }
|
||||
};
|
||||
var lang = (root.lang || "en").slice(0, 2).toLowerCase();
|
||||
var L = LABELS[lang] || LABELS.en;
|
||||
|
||||
function store(v) {
|
||||
try { localStorage.setItem(KEY, v ? "more" : "normal"); } catch (e) {}
|
||||
}
|
||||
|
||||
function paint() {
|
||||
var on = root.classList.contains("hc");
|
||||
document.querySelectorAll(".notes-contrast-toggle").forEach(function (b) {
|
||||
b.setAttribute("aria-pressed", String(on));
|
||||
b.setAttribute("title", on ? L.on : L.off);
|
||||
b.setAttribute("aria-label", on ? L.on : L.off);
|
||||
});
|
||||
}
|
||||
|
||||
function build() {
|
||||
var anchors = document.querySelectorAll(".quarto-color-scheme-toggle");
|
||||
if (anchors.length === 0) return; // a page without Quarto's own tools
|
||||
anchors.forEach(function (a) {
|
||||
var b = document.createElement("button");
|
||||
b.type = "button";
|
||||
b.className = "quarto-navigation-tool px-1 notes-contrast-toggle";
|
||||
// bootstrap-icons ships with these books; the glyph is the fallback
|
||||
b.innerHTML = '<i class="bi bi-circle-half" aria-hidden="true"></i>';
|
||||
b.addEventListener("click", function () {
|
||||
var on = !root.classList.contains("hc");
|
||||
root.classList.toggle("hc", on);
|
||||
store(on);
|
||||
paint();
|
||||
});
|
||||
a.parentNode.insertBefore(b, a.nextSibling);
|
||||
});
|
||||
paint();
|
||||
}
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", build);
|
||||
} else { build(); }
|
||||
})();
|
||||
@@ -0,0 +1,316 @@
|
||||
/* high-contrast.css — the high-contrast pair, taken from GitHub's
|
||||
"GitHub Light High Contrast" and "GitHub Dark High Contrast" VS Code
|
||||
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales).
|
||||
|
||||
It is switched by `hc` on <html>, which calc-notes.lua sets from
|
||||
|
||||
high-contrast: true
|
||||
|
||||
in the document metadata, and which the same in-header script sets for a
|
||||
reader whose system asks for `prefers-contrast: more`. One class rather
|
||||
than a class and a media query, so the palette below is written once.
|
||||
|
||||
It rides on top of the ordinary light/dark pair: `html.hc` restyles the
|
||||
light theme, `html.hc body.quarto-dark` the night one, so the reader's own
|
||||
light/dark toggle keeps working.
|
||||
|
||||
GitHub's two high-contrast themes separate things by outline rather than by
|
||||
fill: text sits at full strength (fg.muted == fg.default), borders are
|
||||
strong, and the tinted panels of the ordinary themes lose their tint. The
|
||||
rules here do the same to the notes environments. */
|
||||
|
||||
/* ---------------------------------------------------------------- light -- */
|
||||
html.hc {
|
||||
/* Primer light_high_contrast */
|
||||
--hc-canvas: #ffffff; /* canvas.default */
|
||||
--hc-inset: #ffffff; /* canvas.inset — separation is by border */
|
||||
--hc-fg: #0e1116; /* fg.default, and fg.muted, which equals it */
|
||||
--hc-subtle: #66707b; /* fg.subtle — the only softened ink */
|
||||
--hc-border: #20252c; /* border.default */
|
||||
--hc-border-soft: #88929d; /* border.muted */
|
||||
--hc-accent: #0349b4; /* accent.fg */
|
||||
--hc-danger: #a0111f; /* danger.fg */
|
||||
--hc-success: #055d20; /* success.fg */
|
||||
--hc-attention: #4e2c00; /* attention.fg */
|
||||
--hc-severe: #702c00; /* severe.fg */
|
||||
--hc-done: #622cbc; /* done.fg */
|
||||
|
||||
/* the extension's own tokens */
|
||||
--calc-ink: var(--hc-fg);
|
||||
--calc-muted: var(--hc-fg);
|
||||
--calc-line: var(--hc-border);
|
||||
--calc-grid: var(--hc-border-soft);
|
||||
--calc-accent-a: var(--hc-accent);
|
||||
--calc-accent-b: var(--hc-severe);
|
||||
--calc-accent-c: var(--hc-success);
|
||||
--calc-danger: var(--hc-danger);
|
||||
--calc-surface: var(--hc-canvas);
|
||||
--calc-faint: var(--hc-border-soft);
|
||||
--calc-shadow: rgba(14, 17, 22, 0.4);
|
||||
--calc-domface: var(--hc-canvas);
|
||||
--calc-domtop: #d8dee4;
|
||||
--calc-notecolor: var(--hc-attention);
|
||||
--calc-furthercolor: var(--hc-done);
|
||||
|
||||
/* the page itself */
|
||||
--bs-body-bg: var(--hc-canvas);
|
||||
--bs-body-color: var(--hc-fg);
|
||||
--bs-emphasis-color: var(--hc-fg);
|
||||
--bs-secondary-color: var(--hc-fg);
|
||||
--bs-tertiary-color: var(--hc-subtle);
|
||||
--bs-border-color: var(--hc-border);
|
||||
--bs-link-color: var(--hc-accent);
|
||||
--bs-link-hover-color: var(--hc-accent);
|
||||
--bs-code-color: var(--hc-fg);
|
||||
--bs-heading-color: var(--hc-fg);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- dark -- */
|
||||
html.hc body.quarto-dark {
|
||||
/* Primer dark_high_contrast, except for the canvas: the theme's own
|
||||
#0a0c10 still reads as a very dark grey next to a black one, so the page
|
||||
goes fully black and every other value keeps its relation to it. */
|
||||
--hc-canvas: #000000; /* canvas.default is #0a0c10 upstream */
|
||||
--hc-inset: #000000; /* canvas.inset */
|
||||
--hc-subtle-bg: #272b33; /* canvas.subtle */
|
||||
--hc-fg: #f0f3f6; /* fg.default == fg.muted */
|
||||
--hc-subtle: #9ea7b3; /* fg.subtle */
|
||||
--hc-border: #7a828e; /* border.default */
|
||||
--hc-border-soft: #7a828e; /* border.muted — the same in this theme */
|
||||
--hc-accent: #71b7ff; /* accent.fg */
|
||||
--hc-danger: #ff9492; /* danger.fg */
|
||||
--hc-success: #26cd4d; /* success.fg */
|
||||
--hc-attention: #f0b72f; /* attention.fg */
|
||||
--hc-severe: #ff803d; /* severe.fg */
|
||||
--hc-done: #cb9eff; /* done.fg */
|
||||
|
||||
/* a stroke on near-black wants the text colour, not the border grey */
|
||||
--calc-line: var(--hc-fg);
|
||||
--calc-grid: var(--hc-border);
|
||||
--calc-domface: var(--hc-subtle-bg);
|
||||
--calc-domtop: #3d444d;
|
||||
--calc-shadow: rgba(1, 4, 9, 0.8);
|
||||
}
|
||||
|
||||
/* the tokens that only alias, so they follow whichever block is in force */
|
||||
html.hc body.quarto-dark {
|
||||
--calc-ink: var(--hc-fg);
|
||||
--calc-muted: var(--hc-fg);
|
||||
--calc-accent-a: var(--hc-accent);
|
||||
--calc-accent-b: var(--hc-severe);
|
||||
--calc-accent-c: var(--hc-success);
|
||||
--calc-danger: var(--hc-danger);
|
||||
--calc-surface: var(--hc-canvas);
|
||||
--calc-faint: var(--hc-border);
|
||||
--calc-notecolor: var(--hc-attention);
|
||||
--calc-furthercolor: var(--hc-done);
|
||||
|
||||
--bs-body-bg: var(--hc-canvas);
|
||||
--bs-body-color: var(--hc-fg);
|
||||
--bs-emphasis-color: var(--hc-fg);
|
||||
--bs-secondary-color: var(--hc-fg);
|
||||
--bs-tertiary-color: var(--hc-subtle);
|
||||
--bs-border-color: var(--hc-border);
|
||||
--bs-link-color: var(--hc-accent);
|
||||
--bs-link-hover-color: var(--hc-accent);
|
||||
--bs-code-color: var(--hc-fg);
|
||||
--bs-heading-color: var(--hc-fg);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------- page chrome -- */
|
||||
/* Quarto's own furniture is compiled from the bootswatch theme, so the
|
||||
variables above do not reach all of it. */
|
||||
html.hc body {
|
||||
background-color: var(--hc-canvas);
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, figcaption, th, td) {
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :is(.text-muted, .quarto-figure figcaption, figcaption.figure-caption,
|
||||
.quarto-title-meta-heading, .quarto-title-meta-contents,
|
||||
.callout-title-container, .footnotes) {
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc a:not(.nav-link):not(.sidebar-item-text) { color: var(--hc-accent); }
|
||||
html.hc a:focus-visible,
|
||||
html.hc button:focus-visible,
|
||||
html.hc summary:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
|
||||
|
||||
html.hc :is(#quarto-sidebar, #quarto-margin-sidebar, .sidebar, .sidebar-navigation,
|
||||
#quarto-header, .navbar, .quarto-secondary-nav) {
|
||||
background-color: var(--hc-canvas);
|
||||
color: var(--hc-fg);
|
||||
border-color: var(--hc-border);
|
||||
}
|
||||
html.hc :is(.sidebar-item-text, .sidebar .nav-link, nav[role="doc-toc"] a, .navbar .nav-link,
|
||||
.quarto-secondary-nav .nav-link) {
|
||||
color: var(--hc-fg);
|
||||
opacity: 1;
|
||||
}
|
||||
html.hc .sidebar nav[role="doc-toc"] ul > li > a,
|
||||
html.hc .sidebar-navigation .sidebar-item a,
|
||||
html.hc .sidebar-navigation .sidebar-item .sidebar-item-text {
|
||||
color: var(--hc-fg);
|
||||
opacity: 1;
|
||||
}
|
||||
/* the active entry: Quarto writes its colour with !important, so this is the
|
||||
one place the palette has to answer in kind */
|
||||
html.hc .sidebar nav[role="doc-toc"] ul > li > a.active,
|
||||
html.hc .sidebar nav[role="doc-toc"] ul > li > ul > li > a.active,
|
||||
html.hc .sidebar nav[role="doc-toc"] ul > li > a:hover,
|
||||
html.hc .sidebar-navigation .sidebar-item a.active,
|
||||
html.hc .sidebar-navigation .sidebar-item a:hover {
|
||||
color: var(--hc-accent) !important;
|
||||
border-left-color: var(--hc-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
html.hc nav[role="doc-toc"] { border-left: 1px solid var(--hc-border-soft); }
|
||||
/* the breadcrumb of the collapsed header carries its own fill in both
|
||||
bootswatch themes, and its ink is the weakest contrast on the page */
|
||||
html.hc .breadcrumb {
|
||||
background-color: var(--hc-canvas);
|
||||
border: 1px solid var(--hc-border);
|
||||
}
|
||||
html.hc :is(.breadcrumb, .breadcrumb-item, .breadcrumb-item a, .quarto-btn-toggle) {
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc .breadcrumb-item a { color: var(--hc-accent); }
|
||||
html.hc :is(hr, .quarto-title-block .quarto-title-banner, header#title-block-header) {
|
||||
border-color: var(--hc-border);
|
||||
}
|
||||
html.hc hr { background-color: var(--hc-border); opacity: 1; }
|
||||
html.hc blockquote {
|
||||
border-left: 4px solid var(--hc-border);
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :is(table, th, td) { border-color: var(--hc-border-soft); }
|
||||
html.hc thead { border-bottom: 2px solid var(--hc-border); }
|
||||
|
||||
/* ------------------------------------------------------------- code ----- */
|
||||
/* GitHub's high-contrast themes give a block an outline instead of a fill. */
|
||||
html.hc :is(pre, div.sourceCode, pre.sourceCode) {
|
||||
background-color: var(--hc-inset);
|
||||
border: 1px solid var(--hc-border);
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :not(pre) > code {
|
||||
background-color: var(--hc-inset);
|
||||
border: 1px solid var(--hc-border-soft);
|
||||
border-radius: 3px;
|
||||
color: var(--hc-fg);
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
html.hc code { color: var(--hc-fg); }
|
||||
|
||||
/* the syntax palette of the same two themes, mapped onto pandoc's classes */
|
||||
html.hc code span:is(.co, .cv, .do, .an, .in) { color: var(--hc-subtle); font-style: italic; }
|
||||
html.hc code span:is(.kw, .cf) { color: var(--hc-danger); }
|
||||
html.hc code span:is(.st, .ch, .sc, .ss, .vs){ color: #032563; }
|
||||
html.hc code span:is(.dv, .bn, .fl, .cn) { color: #023b95; }
|
||||
html.hc code span:is(.fu, .ex) { color: #512598; }
|
||||
html.hc code span:is(.va, .at) { color: var(--hc-severe); }
|
||||
html.hc code span:is(.dt, .bu) { color: var(--hc-success); }
|
||||
html.hc code span:is(.im, .pp) { color: var(--hc-severe); }
|
||||
html.hc code span:is(.er, .wa, .al) { color: var(--hc-danger); font-weight: 600; }
|
||||
html.hc code span:is(.op, .ot) { color: var(--hc-fg); }
|
||||
|
||||
html.hc body.quarto-dark code span:is(.st, .ch, .sc, .ss, .vs) { color: #addcff; }
|
||||
html.hc body.quarto-dark code span:is(.dv, .bn, .fl, .cn) { color: #91cbff; }
|
||||
html.hc body.quarto-dark code span:is(.fu, .ex) { color: #dbb7ff; }
|
||||
html.hc body.quarto-dark code span:is(.co, .cv, .do, .an, .in) { color: #bdc4cc; }
|
||||
|
||||
/* ------------------------------------------- the notes environments ----- */
|
||||
/* out goes the tint; the outline carries the box, at full accent strength */
|
||||
html.hc :is(.exo, .further, .quiz, .gls-inline, .gls-float, .calc-note,
|
||||
.exo-sol, .exo-hint, .quiz-opt) {
|
||||
background: var(--hc-canvas);
|
||||
}
|
||||
html.hc .exo { border-color: var(--calc-notecolor); }
|
||||
html.hc :is(.exo-sol, .exo-hint) { border-color: var(--calc-notecolor); }
|
||||
html.hc .exo-head strong,
|
||||
html.hc .exo-hint > summary { color: var(--calc-notecolor); }
|
||||
html.hc .further { border-color: var(--calc-furthercolor); }
|
||||
html.hc .gls-float { border-color: var(--calc-notecolor); box-shadow: 0 4px 14px var(--calc-shadow); }
|
||||
html.hc :is(.gls-inline, .calc-note) { border-left-width: 4px; }
|
||||
html.hc .gls-sym { text-decoration-color: var(--calc-notecolor); }
|
||||
html.hc .quiz { --quiz-ok: var(--hc-success); --quiz-bad: var(--hc-danger); --quiz-ink: var(--hc-fg); }
|
||||
html.hc :is(.quiz-opt.quiz-ok, .quiz-opt.quiz-bad) { background: var(--hc-canvas); }
|
||||
html.hc .quiz-opt.quiz-ok { outline: 2px solid var(--hc-success); }
|
||||
html.hc .quiz-opt.quiz-bad { outline: 2px solid var(--hc-danger); }
|
||||
|
||||
/* Quarto's own callouts, so a page does not mix outlined boxes with filled
|
||||
ones; the callout keeps its colour, in its left bar and its title */
|
||||
html.hc .callout {
|
||||
background-color: var(--hc-canvas) !important;
|
||||
border: 1px solid var(--hc-border);
|
||||
}
|
||||
html.hc .callout > .callout-header {
|
||||
background-color: var(--hc-canvas) !important;
|
||||
border-bottom: 1px solid var(--hc-border-soft);
|
||||
}
|
||||
html.hc :is(.callout-body, .callout-title-container, .callout-body-container p) {
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc .callout.callout-style-default > div.callout-header { font-weight: 600; }
|
||||
|
||||
/* Quarto's search box: its widget is not themed by the bootswatch pair, so it
|
||||
stays white on a dark page unless it is told otherwise (see theme.css) */
|
||||
html.hc :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item) {
|
||||
background-color: var(--hc-canvas);
|
||||
color: var(--hc-fg);
|
||||
border-color: var(--hc-border);
|
||||
}
|
||||
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapper .aa-Input,
|
||||
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
|
||||
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
|
||||
color: var(--hc-fg);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
/* the results panel: Quarto colours the cards through an id, so this does too */
|
||||
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item,
|
||||
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
|
||||
:is(.search-result-title-container, .search-result-text-container,
|
||||
.search-result-section, .search-result-text, .search-result-more) {
|
||||
background-color: var(--hc-canvas);
|
||||
color: var(--hc-fg);
|
||||
}
|
||||
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item,
|
||||
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item
|
||||
:is(.search-result-title-container, .search-result-text-container,
|
||||
.search-result-section, .search-result-text, .search-result-more) {
|
||||
background-color: var(--hc-accent);
|
||||
color: var(--hc-canvas);
|
||||
}
|
||||
/* a hit is marked by weight and a rule, not by a block of colour */
|
||||
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
|
||||
:is(mark.search-match, .search-match.mark) {
|
||||
background-color: transparent;
|
||||
color: inherit;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* the figure buttons of the animated schemes */
|
||||
html.hc :is(.ns-btn, .nc-btn, .nd-replay) {
|
||||
background: var(--hc-canvas);
|
||||
color: var(--hc-fg);
|
||||
border-color: var(--hc-border);
|
||||
}
|
||||
html.hc :is(.notes-spiral, .notes-cantor) :is(.ns-btn, .nc-btn)[aria-pressed="true"] {
|
||||
background: var(--hc-canvas);
|
||||
border-color: var(--hc-accent);
|
||||
color: var(--hc-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* the last tinted fills: a calc box and a note keep their outline instead */
|
||||
html.hc :is(.calc-box, .calc-note, .calc-note[open]) { background: transparent; }
|
||||
@@ -0,0 +1,106 @@
|
||||
/* narrow.css — the book on a phone.
|
||||
Nothing in the flow may be wider than the screen: a wide formula, table or
|
||||
figure scrolls inside its own box instead of pushing the whole page
|
||||
sideways (which leaves the text cut off at the left edge).
|
||||
Loaded with calc-notes.css, so every page of every book gets it. */
|
||||
|
||||
/* --- display maths ------------------------------------------------------
|
||||
The boxes of this extension (.calc, .exo, .further) already scroll their
|
||||
own maths; this covers every other display formula on the page. */
|
||||
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
|
||||
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
|
||||
/* a centred formula that overflows would hide its left side out of reach,
|
||||
so centre it only while it fits */
|
||||
justify-content: safe center;
|
||||
}
|
||||
|
||||
/* --- everything else that can be wider than a phone ---------------------- */
|
||||
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
|
||||
main :is(img, svg) { max-width: 100%; height: auto; }
|
||||
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
|
||||
|
||||
/* the animated figures of lesson-style chapters */
|
||||
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
|
||||
|
||||
/* the glossary popup: never wider than the screen */
|
||||
.gls-float { max-width: min(92vw, 26rem); }
|
||||
|
||||
/* --- phone-sized screens ------------------------------------------------- */
|
||||
@media (max-width: 575.98px) {
|
||||
/* the equation number of a labelled calc block goes under the line, so the
|
||||
formula keeps the full width */
|
||||
.calc { grid-template-columns: max-content 1fr; }
|
||||
|
||||
/* figure captions and the fold summaries read better tight */
|
||||
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
|
||||
|
||||
/* A bare url in prose, or a long identifier in a code span, is one word to
|
||||
the line breaker and paints past its block on a narrow screen — no
|
||||
element is oversized, so only the text itself overflows. */
|
||||
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
|
||||
|
||||
/* Quarto lets inline code wrap only inside a <p> (white-space: pre-wrap);
|
||||
in a list item or a table it keeps one line, and a formula such as
|
||||
"{PersN} → {PersN, Name, Position, Room, …}" pushed a page to 947px. */
|
||||
#quarto-document-content :not(pre) > code:not(.sourceCode) { white-space: pre-wrap; }
|
||||
|
||||
/* A long compound in running text — "Unternehmensarchitekturmanagement" in
|
||||
a list item is 348px — has no break opportunity. The page's lang picks
|
||||
the hyphenation dictionary; overflow-wrap is the fallback without one. */
|
||||
#quarto-document-content { hyphens: auto; overflow-wrap: break-word; }
|
||||
|
||||
/* An inline formula MathJax cannot break (one long fraction or product)
|
||||
is wider than a phone: 413px in ModernPhysics' first exercise. It scrolls
|
||||
inside its own box instead of pushing the page; the padding keeps tall
|
||||
glyphs clear of the box's edge. */
|
||||
/* A Bootstrap grid (::: {.grid} with .g-col-* items) has 12 columns and 11
|
||||
gaps of 1.5rem: 264px of gaps alone, more than a callout on a phone
|
||||
(248px in SoftwareEngineering's git appendix), so the columns collapse to
|
||||
0 and a full-width item overflows. A smaller gap keeps the layout;
|
||||
min-width: 0 lets an item's text wrap instead of widening its track. */
|
||||
.grid { --bs-gap: 0.75rem; }
|
||||
.grid > [class*="g-col"] { min-width: 0; }
|
||||
|
||||
#quarto-document-content mjx-container:not([display="true"]) {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
vertical-align: middle;
|
||||
padding-block: 0.15em;
|
||||
}
|
||||
|
||||
/* Quarto's own previous/next footer: the chapter titles are laid out in a
|
||||
row that will not shrink, so a long title pushes the page sideways. */
|
||||
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
|
||||
.nav-page, .nav-page .nav-page-text { min-width: 0; }
|
||||
.nav-page .chapter-title { overflow-wrap: break-word; }
|
||||
|
||||
/* A long compound in a heading — "Implementierungsentscheidungen" is 366px
|
||||
at h3 size — is wider than a 320px screen. The page's lang picks the
|
||||
hyphenation dictionary; overflow-wrap is the fallback without one. */
|
||||
#quarto-document-content :is(h1, h2, h3, h4, h5, h6),
|
||||
.quarto-title .title {
|
||||
hyphens: auto;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* The bar at the top of a phone page: menu button, the chapter's title,
|
||||
search. The title is a flex item that will not shrink, so a long one
|
||||
("3 Komplexitätsanalyse" in darkly's wider font) pushes the search button
|
||||
off the screen. It now shrinks and ends in an ellipsis. */
|
||||
.quarto-secondary-nav nav.quarto-page-breadcrumbs { min-width: 0; }
|
||||
.quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb {
|
||||
flex-wrap: nowrap;
|
||||
min-width: 0;
|
||||
}
|
||||
.quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb-item {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/* theme.css — one palette for every part of the notes extension, in light
|
||||
mode, in night mode and in high contrast.
|
||||
|
||||
Night mode keys off Quarto's own `body.quarto-dark`, which the light/dark
|
||||
toggle sets — never off `prefers-color-scheme`, so a book configured
|
||||
light-only stays light for a reader whose system is dark.
|
||||
A book opts in with, in _quarto.yml:
|
||||
format:
|
||||
html:
|
||||
theme:
|
||||
light: [cosmo]
|
||||
dark: [darkly]
|
||||
|
||||
High contrast is a separate sheet, high-contrast.css, after GitHub's two
|
||||
high-contrast VS Code themes. It keys off `hc` on <html>, which
|
||||
calc-notes.lua sets from `high-contrast: true` in the metadata and for a
|
||||
reader whose system asks for `prefers-contrast: more`.
|
||||
|
||||
Loaded with calc-notes.css, so every page of every book has these tokens. */
|
||||
|
||||
:root {
|
||||
--calc-ink: #1a1a1a; /* figure text, strong strokes */
|
||||
--calc-muted: #57606a; /* captions, readouts, button text */
|
||||
--calc-line: #444444; /* axes and rules */
|
||||
--calc-grid: #cccccc; /* lattice dots, faint grid */
|
||||
--calc-accent-a: #1F6FB4; /* lineA of the tikz preamble */
|
||||
--calc-accent-b: #D1541F; /* lineB */
|
||||
--calc-accent-c: #2E8B57; /* lineC */
|
||||
--calc-danger: #B91C1C; /* an error state, e.g. a failed code run */
|
||||
--calc-surface: var(--bs-body-bg, #ffffff);
|
||||
--calc-faint: #e7e9ec; /* hairlines between rows */
|
||||
--calc-shadow: rgba(0, 0, 0, 0.15); /* floats above the page */
|
||||
--calc-domface: #DCE7F2; /* the domino figure's front face */
|
||||
--calc-domtop: #B8CFE4; /* its top face */
|
||||
/* --calc-notecolor-src and --calc-furthercolor-src come from the document
|
||||
metadata (calc-notes.lua / further.lua) and are the book's own colours;
|
||||
--calc-notecolor and --calc-furthercolor are what everything draws with,
|
||||
and equal the source here. The dark block lifts them. */
|
||||
}
|
||||
|
||||
body.quarto-dark {
|
||||
--calc-ink: #e6e9ed;
|
||||
--calc-muted: #9aa4b2;
|
||||
--calc-line: #b6bec7;
|
||||
--calc-grid: #4b535d;
|
||||
--calc-accent-a: #6fb0ea;
|
||||
--calc-accent-b: #f0956a;
|
||||
--calc-accent-c: #64c49a;
|
||||
--calc-danger: #f08a8a;
|
||||
--calc-faint: #3a4049;
|
||||
--calc-shadow: rgba(0, 0, 0, 0.55);
|
||||
--calc-domface: #2b3b4d;
|
||||
--calc-domtop: #365070;
|
||||
/* The book's own accent is kept, not replaced: its print value is too dim
|
||||
on a dark ground, so it is lifted to a light tone at the same hue rather
|
||||
than swapped for a generic amber. A book that wants a specific night
|
||||
value sets `notecolor-dark:` / `furthercolor-dark:` in its metadata.
|
||||
On a browser without relative colour syntax the lift is dropped and the
|
||||
book's own colour is used unchanged. */
|
||||
--calc-notecolor:
|
||||
var(--calc-notecolor-dark,
|
||||
oklch(from var(--calc-notecolor-src, #B45309) 0.78 c h));
|
||||
--calc-furthercolor:
|
||||
var(--calc-furthercolor-dark,
|
||||
oklch(from var(--calc-furthercolor-src, #6B3FA0) 0.80 c h));
|
||||
}
|
||||
|
||||
/* --- generated line art -------------------------------------------------
|
||||
The tikz figures are black-and-colour line drawings on transparent white.
|
||||
Inverting them keeps the drawing readable and, with the hue rotation,
|
||||
keeps blue blue and orange orange. Photographs live under img/ and are
|
||||
left alone; an svg that is a photograph, or that carries its own dark
|
||||
palette, opts out with class="no-invert". */
|
||||
body.quarto-dark main img[src$=".svg"]:not(.no-invert) {
|
||||
filter: invert(1) hue-rotate(180deg);
|
||||
}
|
||||
|
||||
/* --- captions -----------------------------------------------------------
|
||||
Quarto's caption grey reads 4.4:1 on cosmo's white, under WCAG AA. The
|
||||
muted token reads about 6.4:1 in light and in dark, and high contrast
|
||||
makes it the foreground. The list ends with Quarto's most specific caption
|
||||
selector so that :is() gives every entry its weight. */
|
||||
:is(.panel-caption, .figure-caption, .subfigure-caption, .table-caption,
|
||||
figcaption, caption, .margin-caption, .column-margin figcaption,
|
||||
.quarto-layout-cell[data-ref-parent] caption) {
|
||||
color: var(--calc-muted, #57606a);
|
||||
}
|
||||
|
||||
/* --- breadcrumbs --------------------------------------------------------
|
||||
Quarto greys the current page (#6c757d) and Bootstrap the separators; on
|
||||
darkly's breadcrumb band that reads 2.1:1. The ink token passes in every
|
||||
mode. `body` outweighs Quarto's own selectors; pseudo-elements cannot go
|
||||
inside :is(), hence the separate rule. */
|
||||
body :is(.quarto-title-breadcrumbs .breadcrumb li:last-of-type a,
|
||||
.breadcrumb-item.active) {
|
||||
color: var(--calc-ink, #1a1a1a);
|
||||
}
|
||||
body .breadcrumb-item + .breadcrumb-item::before,
|
||||
body .quarto-secondary-nav nav.quarto-page-breadcrumbs .breadcrumb-item::before,
|
||||
body .quarto-secondary-nav nav.quarto-page-breadcrumbs a {
|
||||
color: var(--calc-ink, #1a1a1a);
|
||||
}
|
||||
|
||||
/* --- Quarto's other greys -----------------------------------------------
|
||||
Quarto hard-codes #6c757d for every fold label (details > summary) and for
|
||||
the previous/next page links, and a mid grey for section numbers: 3.4:1 on
|
||||
darkly, 4.4:1 on cosmo. The muted token reads about 6.4:1 in both, and
|
||||
high contrast makes it the foreground. An exercise hint keeps its accent
|
||||
(.exo-hint > summary outweighs these), and the active entry of the
|
||||
contents still inherits its colour. */
|
||||
body details > summary,
|
||||
body .nav-page a,
|
||||
body .header-section-number {
|
||||
color: var(--calc-muted, #57606a);
|
||||
}
|
||||
|
||||
/* Quoted text: Quarto's .blockquote grey is 4.4:1 on cosmo, and it names the
|
||||
paragraphs, so they are named here too. */
|
||||
body :is(blockquote, .blockquote, blockquote p, .blockquote p) {
|
||||
color: var(--calc-muted, #57606a);
|
||||
}
|
||||
|
||||
/* Inline code: Bootstrap's pill is #f8f9fa in both themes, so darkly's light
|
||||
code text sat on near-white (1.05:1). The pill is now a faint tint of the
|
||||
page, which keeps each theme's code colour readable, and inherited muted
|
||||
text (code in a caption) too. */
|
||||
body :not(pre) > code:not(.sourceCode) {
|
||||
background-color: color-mix(in srgb, var(--calc-faint, #e7e9ec) 60%,
|
||||
var(--calc-surface, #ffffff));
|
||||
}
|
||||
|
||||
/* A code block inside a tinted box (exercise, hint, solution, "to go
|
||||
further", quiz): Quarto's block ground is 65% opaque, so the tint shows
|
||||
through and a11y-light's keyword red drops to 4.4:1. Here the ground is
|
||||
opaque, and the same light grey as on the page. */
|
||||
body :is(.exo, .exo-hint, .exo-sol, .further, .quiz) div.sourceCode {
|
||||
background-color: color-mix(in srgb, var(--calc-faint, #e7e9ec) 45%,
|
||||
var(--calc-surface, #ffffff));
|
||||
}
|
||||
/* A static (not executed) block also gives its <code> the translucent
|
||||
ground, so the two layers stack and darken it. The block carries the
|
||||
ground; the code inside is transparent, as in an executed cell. */
|
||||
body div.sourceCode > pre > code.sourceCode { background-color: transparent; }
|
||||
|
||||
/* --- Jupyter output: ANSI colours ---------------------------------------
|
||||
A traceback comes out in the notebook's terminal palette, made for a dark
|
||||
terminal: yellow is 1.9:1 and cyan 2.0:1 on the page. Each colour name
|
||||
takes the matching token with a fifth of ink, which keeps the hue and passes
|
||||
in all four modes. IPython's 256-colour spans carry inline styles and no
|
||||
name, so they take the text colour. */
|
||||
body :is(.ansi-black-fg, .ansi-bright-black-fg) { color: var(--calc-ink); }
|
||||
body :is(.ansi-white-fg, .ansi-bright-white-fg) { color: var(--calc-muted); }
|
||||
body :is(.ansi-red-fg, .ansi-bright-red-fg) {
|
||||
color: color-mix(in srgb, var(--calc-danger) 85%, var(--calc-ink));
|
||||
}
|
||||
body :is(.ansi-green-fg, .ansi-bright-green-fg) {
|
||||
color: color-mix(in srgb, var(--calc-accent-c) 75%, var(--calc-ink));
|
||||
}
|
||||
body :is(.ansi-yellow-fg, .ansi-bright-yellow-fg) {
|
||||
color: color-mix(in srgb, var(--calc-accent-b) 75%, var(--calc-ink));
|
||||
}
|
||||
body :is(.ansi-blue-fg, .ansi-bright-blue-fg) {
|
||||
color: color-mix(in srgb, var(--calc-accent-a) 80%, var(--calc-ink));
|
||||
}
|
||||
body :is(.ansi-magenta-fg, .ansi-bright-magenta-fg) {
|
||||
color: color-mix(in srgb, var(--calc-furthercolor) 85%, var(--calc-ink));
|
||||
}
|
||||
body :is(.ansi-cyan-fg, .ansi-bright-cyan-fg) {
|
||||
color: color-mix(in srgb,
|
||||
color-mix(in srgb, var(--calc-accent-a) 50%, var(--calc-accent-c)) 75%,
|
||||
var(--calc-ink));
|
||||
}
|
||||
body .ansi-escaped-output span[style*="color"] { color: inherit !important; }
|
||||
|
||||
/* --- higher contrast ---------------------------------------------------
|
||||
The high-contrast pair lives in high-contrast.css, which is loaded with
|
||||
this file and keys off `hc` on <html>. */
|
||||
|
||||
/* --- Quarto's search box -------------------------------------------------
|
||||
The search widget keeps its own white surface whatever the bootswatch
|
||||
theme says, so on a dark page it is a white slab with dark text. It is
|
||||
given the page's own surface here rather than in each book. */
|
||||
body.quarto-dark :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item,
|
||||
.aa-DetachedContainer, .aa-DetachedFormContainer) {
|
||||
background-color: var(--calc-surface, #222);
|
||||
color: var(--calc-ink, #e6e9ed);
|
||||
border-color: var(--calc-faint, #3a4049);
|
||||
}
|
||||
/* The ink inside the form is a separate problem from its surface: Quarto's
|
||||
dark bundle sets the input, its placeholder, the clear button and the
|
||||
magnifier to rgb(45,45,45) through a four-class selector, so a short one
|
||||
loses the cascade and the typed text stays unreadable. The shape below
|
||||
matches Quarto's own, which is the only way to win without !important. */
|
||||
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapper .aa-Input,
|
||||
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
|
||||
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
|
||||
color: var(--calc-ink, #e6e9ed);
|
||||
}
|
||||
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
|
||||
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
|
||||
color: var(--calc-muted, #9aa4b2);
|
||||
}
|
||||
|
||||
/* --- search: the selected result ----------------------------------------
|
||||
Quarto marks it with cosmo's primary (#2780e3) under white text, 3.97:1,
|
||||
and its matched words with a lighter blue, worse still. The same hue at a
|
||||
lower lightness passes. Night mode (darkly's #375a7f, 7.2:1) and high
|
||||
contrast (high-contrast.css) keep their own. */
|
||||
html:not(.hc) body:not(.quarto-dark) :is(.aa-DetachedOverlay, #quarto-search-results)
|
||||
li.aa-Item[aria-selected="true"] :is(.search-item, .search-item *:not(mark, .mark)) {
|
||||
background-color: oklch(from var(--bs-primary, #2780e3) 0.42 c h);
|
||||
}
|
||||
html:not(.hc) body:not(.quarto-dark) :is(.aa-DetachedOverlay, #quarto-search-results)
|
||||
li.aa-Item[aria-selected="true"] .search-item :is(mark.search-match, .search-match.mark) {
|
||||
background-color: oklch(from var(--bs-primary, #2780e3) 0.52 c h);
|
||||
}
|
||||
|
||||
/* --- the high-contrast switch -------------------------------------------
|
||||
Built by calc-notes.js next to Quarto's light/dark toggle, and styled to
|
||||
sit with it rather than stand out. */
|
||||
.notes-contrast-toggle {
|
||||
background: none;
|
||||
border: 0;
|
||||
color: inherit;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.notes-contrast-toggle:hover { opacity: 1; }
|
||||
.notes-contrast-toggle[aria-pressed="true"] {
|
||||
opacity: 1;
|
||||
color: var(--calc-accent-a, #1F6FB4);
|
||||
}
|
||||
.notes-contrast-toggle:focus-visible {
|
||||
outline: 2px solid var(--calc-accent-a, #1F6FB4);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
Reference in new issue
Block a user