Repository navigation
Expand file tree
/
Copy pathstyles.scss
More file actions
895 lines (815 loc) · 42.2 KB
/
Copy pathstyles.scss
File metadata and controls
895 lines (815 loc) · 42.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
/* ─────────────────────────────────────────────────────────────────────────
LECTURE CORE STYLES — single source of truth
Generated into each lecture by scripts/sync-core-scss.py. DO NOT EDIT the
copy inside a lecture repo; edit this file and re-run the script.
Theme order in every lecture (wired by scripts/wire-dark-mode.py):
theme:
light: [default, styles.scss, brand]
dark: [default, _dark.scss, styles.scss, brand]
styles.scss is this file (it @imports _fonts.scss and _paper-and-ink.scss)
followed by the lecture's LOCAL fragment. _dark.scss is the dark layer and
sits in the dark list only.
Two things about that order, both verified against a real render:
1. Quarto emits `scss:defaults` in REVERSE theme order. So `brand` is
declared first (which is why `$brand-*` resolves at all), and
`_dark.scss` after this file, so its plain assignments replace the light
values in the dark bundle. A plain assignment in a lecture's LOCAL
fragment pre-empts any `!default` below: that is how
Study-Business-Basics remaps the palette.
2. `scss:rules` are emitted in FORWARD order, so a lecture's local rules
come after these and win on a tie.
── Why the colours below are literal hex, not `$brand-*` ──────────────────
Only four palette tokens exist in ALL sixteen lectures: `codeline`,
`darker`, `greyer`, `lighter`. Study-Business-Basics has no `oneDark` /
`twoDark` / `threeDark` at all — its palette is `sand` / `teal` /
`dangerColor`, with different hex values. Referencing `$brand-twoDark` here
would therefore fail to COMPILE in that one lecture. The four universal
tokens are used directly; everything else goes through a `!default`
variable, and each hex is annotated with the token it mirrors.
───────────────────────────────────────────────────────────────────────── */
/*-- scss:defaults --*/
// ── Paper & Ink ───────────────────────────────────────────────────────────
// Code surfaces, inline code and the dark page come from paper-and-ink-theme/
// build.py, copied next to styles.scss as _paper-and-ink.scss by
// scripts/sync-core-scss.py. Code block colours come from the two synced
// highlight themes (_paper-and-ink-*.theme, wired by wire-dark-mode.py).
@import "paper-and-ink";
// Plain assignments: the brand layer, which Quarto emits first, sets its own
// codeline and inline colour; these win. The dark layer (_dark.scss) comes
// after this file and replaces them in the dark bundle.
$code-block-bg: $pi-light-code-surface;
$code-bg: $pi-light-code-surface;
// Inline code in the brand's slate teal (twoDark, darkened for the chip:
// 4.61:1 on #FFEEE2); dark mode takes its twoLight pair (9.56:1 on #191B1D).
// A rule below applies it, so a course's LOCAL `$lec-code-inline` still wins.
$lec-code-inline: #4B7282 !default;
$lec-code-inline-on-dark: #A7C7C6 !default;
$pre-bg: $pi-light-code-surface; // plain blocks and cell output: the same surface
// ── Semantic colours ──────────────────────────────────────────────────────
// Override any of these in a lecture's styles.scss if its palette differs.
// Contrast ratios are against the slide/page background #FFFDFC (`lighter`).
// WCAG AA: 4.5:1 for body text, 3:1 for large text.
$lec-emphasis: #537E8F !default; // = twoDark. .reveal strong / em 4.36:1
$lec-task: #B25F00 !default; // NEW. .task 4.57:1
$lec-highlight: #9E2B2B !default; // oxblood. .highlight / .errors 7.31:1
$lec-loud-bg: #537E8F !default; // = twoDark. .loud-slide background
$lec-question: $brand-greyer !default; // .question 7.84:1
// `.flow` headings (rule and the story of these stops further down). A
// variable, so the dark layer can swap the stops.
$lec-flow-gradient: linear-gradient(
to right,
#363D45 0%, // darker 10.84:1
#506061 14%, // photo slate 6.50:1
#537E8F 28%, // twoDark 4.36:1
#5D969B 42%, // photo teal 3.29:1
#b87d33 54%, // warm glint 3.44:1
#537E8F 68%,
#506061 84%,
#363D45 100% // == 0%, for a seamless wrap
) !default;
// ANSI output (tracebacks, coloured logs): Paper & Ink's terminal palette, the
// colours Zed's terminal shows. The notebook palette Quarto ships failed AA
// on the light page (yellow 1.9:1, cyan 2.0:1). Each hue: (base, bright).
$lec-ansi: (
red: ($pi-light-ansi-red, $pi-light-ansi-bright-red),
green: ($pi-light-ansi-green, $pi-light-ansi-bright-green),
yellow: ($pi-light-ansi-yellow, $pi-light-ansi-bright-yellow),
blue: ($pi-light-ansi-blue, $pi-light-ansi-bright-blue),
magenta: ($pi-light-ansi-magenta, $pi-light-ansi-bright-magenta),
cyan: ($pi-light-ansi-cyan, $pi-light-ansi-bright-cyan),
) !default;
$lec-ansi-grey: $pi-light-ansi-bright-black !default; // Julia's de-emphasised grey
$lec-ansi-on-colour: $pi-light-ground !default; // text on an ANSI background
$lec-line-number: $pi-light-line-number !default; // code-line-numbers; Quarto ignores the theme's LineNumbers
// $lec-highlight is oxblood, the single red accent — the same colour as the
// logo mark and the links (set in _brand.yml). It replaced #B3403F so every
// red on the page is one identical red against the otherwise-teal system.
// On the slate plate of `.invert-font` the three colours above fail (.task
// 2.37:1, .highlight 1.48:1, .question 1.38:1), so there each takes a colour
// of its palette pair that reads on slate. Contrast against `darker` #363D45.
// #F6B265 failed as type on the pale ground (1.80:1, see below) and passes here.
$lec-task-on-dark: #F6B265 !default; // = oneDark. 6.01:1
$lec-question-on-dark: #A7C7C6 !default; // = twoLight. 6.09:1
$lec-highlight-on-dark: #EBADAD !default; // = threeLight. 5.82:1
// `.question` uses $brand-greyer (#3D5369, 7.84:1) and `.invert-font` /
// `.title-slide.title` / `.exercise-slide` use $brand-lighter / -darker /
// -codeline. All four tokens are universal, so they are referenced directly.
// Quarto's slide grey ($text-muted, body colour lightened 30 %: #7C8998) is
// 3.51:1 on the page ground. Footer, slide number, slide blockquotes and
// asides take a darker grey. It has to hold on the section slides too, which
// sit on `codeline`: #697480 was 4.70:1 on the page and 4.21:1 there.
$lec-slide-muted: #646C76 !default; // page 5.24:1 / 5.14:1, codeline 4.71:1 / 4.63:1
// ── Callouts ──────────────────────────────────────────────────────────────
$lec-callout-note: #FCCF9C !default; // = oneLight
$lec-callout-tip: #A7C7C6 !default; // = twoLight
$lec-callout-warning: #EBADAD !default; // = threeLight
$lec-callout-important: #F6B265 !default; // = oneDark
$lec-callout-caution: #DB6B6B !default; // = threeDark
$lec-code-border: #EBADAD !default; // = threeLight
$callout-color-note: $lec-callout-note;
$callout-color-tip: $lec-callout-tip;
$callout-color-warning: $lec-callout-warning;
$callout-color-important: $lec-callout-important;
$callout-color-caution: $lec-callout-caution;
$code-block-border-left: $lec-code-border;
// ── Heading sizes ─────────────────────────────────────────────────────────
// HTML documents only. Slides size headings via $presentation-*-font-size and
// are unaffected.
$h1-font-size: 1.75rem;
$h2-font-size: 1.5rem;
$h3-font-size: 1.3rem;
$h4-font-size: 1.15rem;
// ── RevealJS ──────────────────────────────────────────────────────────────
$presentation-title-slide-text-align: left;
/*-- scss:rules --*/
// ── Self-hosted brand fonts ───────────────────────────────────────────────
// Gelasio / Reddit Sans / Google Sans Code, base64-embedded as @font-face.
// Vendored by scripts/sync-fonts.py; regenerate with `--generate`.
//
// This is @import-ed rather than added to the `theme:` lists on purpose. About
// 25 pages across Materiallogistik, Produktionswirtschaft and
// Optimization-with-Julia declare their own `theme:` in front matter, which
// REPLACES the project's — anything wired only into the project theme silently
// misses them. Coming in through styles.scss means every page that already
// loads styles.scss gets the fonts, with no YAML changes anywhere.
//
// Without this, `source: google` in _brand.yml makes Quarto emit an @import of
// fonts.googleapis.com into every page's CSS, sending each visitor's IP to
// Google on every page view.
@import "fonts";
// ── Slide headings ────────────────────────────────────────────────────────
// _brand.yml gives headings a line height of 1.4, which suits a page. A slide
// title is one line, and the 13px it costs below every title pushed slides
// over the edge: 21 of the 40 flagged slides in Management-Science
// (research/slide-sizes.md, 2026-10-09). 1.2 is Reveal's own value. The theme
// reads it from this variable, so it is set here rather than on the headings.
.reveal {
--r-heading-line-height: 1.2;
}
// ── Text column ───────────────────────────────────────────────────────────
// The stage is 1280px wide, and a line of 40px text across all of it holds
// about 65 characters: long to read from the back of a room. A slide's content
// gets 1200px, about 61 characters, with 40px free on each side. Backgrounds
// keep the whole stage, and so do the games.
//
// A border, not padding: Reveal's print rules reset a slide's padding, and the
// width Reveal fits text to (below) leaves out borders only.
.reveal .slides section:not(.stack) {
border-inline: 40px solid transparent;
box-sizing: border-box;
}
.reveal .slides section:not(.stack):has(.gamekit-slide) {
border-inline-width: 0;
}
// Reveal sizes a stretched element (r-stretch: an image, an embedded page)
// against the stage, not against the column, and writes that width into the
// element.
.reveal .slides .r-stretch {
max-width: 100%;
}
.reveal .slides img.r-stretch {
object-fit: contain;
}
// ── Fitted text (r-fit-text) ──────────────────────────────────────────────
// Reveal sizes fitted text by the slide's width alone. On the 16:9 stage a
// loud slide of two or three lines ("Any questions?") came out taller than the
// slide. So the slide gives the text 84% of its width, 3:2 over 16:9: the text
// is as large as on the old stage, what fitted there fits here, and the free
// sixth is split evenly left and right.
//
// A border, because Reveal fits the text to the slide's inner width, and that
// leaves out borders but not padding. 102px is 8% of the 1280px stage (a
// border takes no percentage); it replaces the text column's 40px here. This is plain layout, so it holds in every
// browser and in the PDF. Two visual shortcuts did not (2026-10-09): `zoom`
// cancels itself out in Safari's engine, which reports the zoomed width to
// Reveal, and `scale` leaves the full-size box in the layout, which Chromium
// pushes off the page when printing, so the PDF page came out empty.
.reveal .slides section:has(> .r-fit-text) {
border-inline: 102px solid transparent;
box-sizing: border-box;
}
// ── Text emphasis (slides) ────────────────────────────────────────────────
.reveal strong,
.reveal b,
.reveal .bold {
color: $lec-emphasis;
font-size: 1em;
font-weight: 600;
}
.reveal em,
.reveal i,
.reveal .italic {
font-style: italic;
color: $lec-emphasis;
font-weight: 400;
}
// ── Utility text classes ──────────────────────────────────────────────────
// These carry inline TEXT, so they need the 4.5:1 body bar, not the 3:1 large
// bar. The old values did not clear it: .task was #F6B265 at 1.80:1 across 334
// usages, .highlight #DB6B6B at 3.27:1 across 2,238. The light palette tints
// they used are fine as fills and callout backgrounds — just not as type.
.highlight {
color: $lec-highlight;
font-weight: bold;
}
.task {
color: $lec-task;
font-weight: bold;
}
.question {
color: $lec-question;
font-weight: bold;
}
.errors {
color: $lec-highlight;
font-weight: bold;
}
// Emphasis on a dark ground. The emphasis colours above are tuned for the pale
// ground and are hard to read on a dark one: teal or oxblood on slate. On a
// slide with a dark background colour (reveal's `has-dark-background`), in an
// `.invert-font` box and on a `.loud-slide`, weight carries the emphasis and
// the colour follows the text. `:where()` keeps the weight of the rules
// above, so a course's own rule still wins. In an `.invert-font` plate the
// three classes with a meaning of their own get a light colour instead (below).
.reveal :where(section.has-dark-background, .invert-font, .loud-slide) {
strong, b, em, i, .bold, .italic, .highlight, .task, .question, .errors {
color: inherit;
}
}
// ── Slide blocks ──────────────────────────────────────────────────────────
// Text on a photo sits on a slate plate.
.invert-font {
color: $brand-lighter;
background-color: $brand-darker;
border: 5px solid $brand-darker;
border-radius: 0;
.task { color: $lec-task-on-dark; }
.question { color: $lec-question-on-dark; }
.highlight, .errors { color: $lec-highlight-on-dark; }
}
// A link on a plate keeps its underline and takes the plate's text colour:
// the link red reaches 1.5:1 on slate (the photographer's name in a photo
// credit). `:any-link` lifts the rule over reveal's own link colours, in the
// footer too, whatever order the theme layers come in.
.invert-font a:any-link,
.reveal .invert-font a:any-link,
.reveal .footer .invert-font a:any-link {
color: inherit;
}
// On a slide the plate follows each line with the same room left and right
// (`box-decoration-break`). The lines of one text join into one block; a thin
// gap separates it from the plates above and below (title, text, question).
// Vertical padding on an inline plate does not move any line. Only spans and
// divs carry the class today; any other element keeps the old box.
.reveal div.invert-font {
border: 0;
padding: 5px 16px;
}
.reveal span.invert-font {
border: 0;
padding: 1px 16px 3px;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
// A block that opens with a plate reaches 16px into the slide's margin, so its
// text keeps the left edge of every other slide and no line is shorter than it
// was with the old box. Only for blocks that span the slide: in a column, a
// list or a callout the plate stays inside its container. Two rules, so a
// browser without `:has()` still places the block plates.
.reveal .slides :is(section:not(.scrollable), section:not(.scrollable) > div.fragment) > div.invert-font {
margin-left: -16px;
margin-right: -16px;
}
.reveal .slides :is(section:not(.scrollable), section:not(.scrollable) > div.fragment) > :is(h1, h2, h3, p):has(span.invert-font) {
margin-left: -16px;
margin-right: -16px;
}
// Section-break slide.
.title-slide.title {
background-color: $brand-codeline !important;
}
// Exercise-break slide ("Your turn"), from Introduction-to-Python.
// Scoped to .reveal: on the HTML page the class lands on the whole
// section.level1 and would tint every paragraph under the heading.
.reveal .exercise-slide {
background-color: $brand-codeline !important;
}
// Light type on the accent, not amber-on-teal: the old pairing (#F6B265 on
// #537E8F) was 2.42:1 across 69 slides — the least readable thing on the site.
// This is Study-Business-Basics' treatment, which reaches 4.36:1.
//
// Every accent colour in the palette is tuned against the PALE ground and goes
// invisible on this one: `strong`/`em` are $lec-emphasis, which IS this
// background, and the link colour lands near 1.6:1. So on the accent, weight
// carries the emphasis and hue never does.
//
// Bold is scoped rather than blanket: the fleet's 90 `.loud-slide`s are all
// one-line `::: {.r-fit-text}` statements and stay bold, while a slide that
// carries real prose (Introduction-to-Python's checkpoint procedure) gets a
// readable body weight instead of a wall of bold.
.reveal .loud-slide {
background-color: $lec-loud-bg !important;
color: $brand-lighter !important;
h1, h2, h3, strong, b, em, i, a {
color: $brand-lighter !important;
}
h1, h2, h3, strong, b, .r-fit-text {
font-weight: bold !important;
}
}
// ── Animated section headings ─────────────────────────────────────────────
.flow {
// Was a 4.2 MB photo from an external CDN, upscaled and aspect-stretched,
// that painted #B5C5B5 (1.78:1) into the letterforms.
//
// These stops are that photo's own dominant colours — it is the image the
// whole brand palette was sampled from, so this is the same colourway, not
// a new one. Every stop clears the 3:1 large-text bar. The brand gold
// #e4b169 is 1.92:1 and is deliberately absent; #b87d33 (3.44:1) carries
// the warm glint instead.
//
// First and last stops are identical and the animation advances exactly one
// tile, so the loop is seamless. (The photo version was not: it jumped 0.8
// of a tile on every wrap.)
background-image: $lec-flow-gradient;
background-size: 1400px 100%;
background-repeat: repeat;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
background-clip: text;
animation: animate 60s linear infinite;
font-family: $presentation-heading-font;
}
@keyframes animate {
from { background-position: 0 0; }
to { background-position: 1400px 0; }
}
@media (prefers-reduced-motion: reduce) {
.flow {
animation: none;
}
}
// ── Sidebar logo ──────────────────────────────────────────────────────────
// The course SVG is viewBox-only, so it needs an explicit bound or it fills the
// sidebar. The mark is square, so capping height caps width.
.sidebar-logo {
max-height: 120px;
width: auto;
}
// ── Page title ────────────────────────────────────────────────────────────
// Quarto sizes the document title independently of $h1-font-size, so setting
// that variable alone does not shrink it — which is exactly why Grundlagen-OR
// and Mathematics each grew their own hand-tuned override (1.9rem and 2rem).
// Deriving it from the same variable keeps the heading scale on one knob.
// #title-block-header does not exist in RevealJS, so slides are unaffected.
#title-block-header .title {
font-size: $h1-font-size;
line-height: 1.25;
}
// ── Tabsets ───────────────────────────────────────────────────────────────
// Compact enough to fit on one row. From Applied-Optimization; Mathematics has
// tabsets in 14 files and had no styling for them.
.panel-tabset .nav-tabs .nav-link {
font-size: 0.9em;
padding: 0.3rem 0.7rem;
}
// ── Slide images ──────────────────────────────────────────────────────────
// Quarto's auto-stretch only fires when the image is the LAST element on the
// slide. Put a caption underneath and it stops applying, so the image scales
// unbounded and runs off the slide. This caps it.
//
// `:not(.r-stretch)` matters: auto-stretch is deliberate where it is used, and
// Reveal implements it by setting an inline height at runtime. Excluding it
// here keeps that explicit rather than relying on inline-style precedence.
// (Grundlagen-OR uses r-stretch in 12 deck files, Introduction-to-Python in 10.)
//
// The cap must be in stage pixels, not vh: vh tracks the browser window while
// the slide stage is a fixed 720px box that Reveal transform-scales, so a vh
// cap makes image size (and overflow) depend on the viewer's window. And no
// width/height:auto: that discards Quarto's logical size attributes and shows
// retina 2x PNGs at double size and half sharpness.
//
// object-fit: an image with a width of its own (`width="90%"`) that reaches
// the cap would otherwise be squashed to fit both: 28 images in
// Applied-Optimization came out distorted (2026-10-09).
//
// 540px is 75% of the 720px stage: a title and one image fit up to about 570px
// (measured in Applied-Optimization, 2026-10-09: 3 slides overflow at 540,
// 22 at 600). It was 420px, 60% of the old 700px stage.
.reveal .slides img:not(.r-stretch) {
max-height: 540px;
object-fit: contain;
}
// A computed figure (figure-revealjs/ output, not a hand-placed image) inside
// ::: {.columns} fills its column. SVG output otherwise keeps its intrinsic
// point size (a 4 in figure is ~300 px wide), so tick labels end up unreadably
// small next to the column's text. Same cap.
.reveal .columns .column img.quarto-figure:is([src*="figure-revealjs/"], [data-src*="figure-revealjs/"]) {
width: 100%;
height: auto;
max-height: 540px;
object-fit: contain;
}
// Quarto marks the slide holding the bibliography as `.smaller .scrollable`
// on its own, so everything on it shrinks to 0.7em: also a closing slide
// ("Next Up", "Literature") that the list merely hangs below. Undo that for the
// slide and keep the smaller size for the list alone. Headings need their own
// reset: Quarto scales them by 1/0.7.
//
// `.csl-bib-body`, not `#refs`: split_refs_post.py spreads a long list over
// several slides, and only the first keeps that id. The list stays small
// because the splitter's four entries per slide are sized for it: at 40px
// four entries are 870 to 1025px tall on a 720px stage (Applied-Optimization,
// 2026-10-09).
.reveal .slides section.smaller:has(.csl-bib-body) {
font-size: 1em;
h2 {
font-size: var(--r-heading2-size);
}
h3 {
font-size: var(--r-heading3-size);
}
.csl-bib-body {
font-size: 0.7em;
}
}
// A URL in an entry has no place to break, so it ran out of the slide to the
// right.
.reveal .csl-entry {
overflow-wrap: anywhere;
}
// ── Slide tables ──────────────────────────────────────────────────────────
// Reveal centres a table, rules every row but the last as strongly as the
// header and leaves no space below it: the table started at another edge
// than the title and the text, and ran into the paragraph after it. A table
// starts at the slide's left edge, has one strong rule under its header and
// fainter lines between its rows, sets its digits at equal width and keeps
// some distance from what follows. Number columns are right-aligned in
// the source (`|---:|`); a stylesheet cannot know which columns hold numbers.
// Two columns stay 1em apart, as before (0.5em on each side). Only the first
// column's left and the last column's right padding are gone, so no table is
// wider than it was.
.reveal table {
margin-left: 0;
font-variant-numeric: tabular-nums lining-nums;
}
// The distance is for what follows the table. A table that ends its
// container (the output of a code cell, a column, a callout) would only make
// that container taller: a pandas table at the bottom of a full slide
// overflowed by exactly this margin.
.reveal table:not(:last-child) {
margin-bottom: 0.9em;
}
.reveal table th,
.reveal table td {
padding: 0.2em 1em 0.2em 0;
border-bottom: 0;
}
// :where() keeps this at the weight of the rule above, so a course's own
// table rule still wins: the simplex tableaus in Grundlagen-Operations-Research
// set their padding themselves, and lost it on the right in the last column.
.reveal table th:where(:last-child),
.reveal table td:where(:last-child) {
padding-right: 0;
}
// Only the last header row: a DataFrame prints two (names, then types), and
// a rule under each cut the header in half.
.reveal table thead tr:last-child th {
border-bottom: 2px solid;
}
// Lines between the rows, half as dark and half as thick as the header rule.
// Without any, a table whose cells run over several lines read as one block.
// The line takes its pixel from the cell's padding, so no table gets taller.
// `:where()` keeps the weight of the padding rule above, so a course's own
// table rule still wins.
.reveal table :where(tbody) td,
.reveal table :where(tbody) th {
border-bottom: 1px solid color-mix(in srgb, currentColor 50%, transparent);
padding-bottom: calc(0.2em - 1px);
}
.reveal table :where(tbody tr:last-child) td,
.reveal table :where(tbody tr:last-child) th {
border-bottom: 0;
padding-bottom: 0.2em;
}
// Slide PDFs: printing, Chromium draws the rules of a table inside an
// .r-stack a second time, repeated at row height down to the page bottom
// (Grundlagen-OR, lectures 02 and 04). In the PDF only (reveal sets
// html.print-pdf), a strip at the foot of each cell draws the rules instead of
// borders, with the widths and colours of the rules above. Borders in the
// separate model vanish in that print entirely, and inset shadows show their
// side edges as vertical seams. A course whose row rules differ sets
// --print-row-rule (a colour) on such tables.
html.print-pdf .reveal .r-stack table {
border-collapse: separate;
border-spacing: 0;
--bs-table-bg: transparent;
th, td {
border: 0 !important;
box-shadow: none !important;
background: none !important;
}
thead tr:last-child th {
background: linear-gradient(currentColor, currentColor) bottom / 100% 2px no-repeat !important;
}
tbody :is(td, th) {
background:
linear-gradient(var(--print-row-rule, color-mix(in srgb, currentColor 50%, transparent)),
var(--print-row-rule, color-mix(in srgb, currentColor 50%, transparent)))
bottom / 100% 1px no-repeat !important;
}
tbody tr:last-child :is(td, th) {
background: none !important;
}
}
// ── Document pages: columns and figures ───────────────────────────────────
// Scoped to #quarto-document-content, which does not exist in RevealJS, so the
// slide rule above is untouched.
//
// Two separate bugs, both from Grundlagen-OR:
// · Quarto lays columns out as adjacent inline-blocks with no gutter. As a
// flexbox with `gap` they get one — but only if `min-width: 0` releases the
// flex minimum-size floor, or the columns refuse to shrink below their
// content.
// · Julia plot output (.cell-output-display) carries no .img-fluid class, so
// it rendered at pixel width and pushed a horizontal scrollbar onto the page.
//
// On phones, columns that hold text or a box stack: beside a figure, a box
// broke words mid-way and its formulas ran out of it. The text may sit in a
// slide fragment (.fragment, .incremental); a figure's own <p> doesn't count,
// so pairs of figures stay side by side, and so do two columns that each
// hold just one image without caption (a <p> around the <img>). DataFrames.jl
// tables already scroll in their .data-frame wrapper and are left alone.
// (No :has() inside a :has(): it can't nest, and :is() would silently drop
// that part; the image pairs are two :has() side by side in a :not().)
// Quarto writes each column's width inline, hence !important; a flex item
// keeps its children's margins, so the second column's top margin would
// double the gap between two stacked boxes.
//
// Also on phones, wide tables and formulas scroll on their own instead of
// widening the page (a third of the Grundlagen-OR pages did). Tables keep
// their content's width and still wrap text; formulas scroll in their
// paragraph (MathML or MathJax; neither breaks a line; not in a list item, whose overflow
// would clip its bullet). Outside boxes both may reach 1.25rem into the right
// page margin (26px on phones), as they did before, so one that is a few
// pixels too wide is not cut off (inside a callout they would cover its
// border). A small shadow at an edge shows there is more to swipe to: the two
// covering gradients scroll with the content, the two shadows stay put, 1px
// in from the edge so the edge pixel leaves no hairline. Long
// words in headings hyphenate (`lang` is set), so a word like
// "Produktionsprogrammplanung" and its anchor icon fit.
//
// 10 lectures use ::: {.columns} across 49 files.
#quarto-document-content {
.columns {
display: flex;
gap: 2rem;
align-items: flex-start;
}
.column {
min-width: 0;
}
@media (max-width: 575.98px) {
.columns:has(> .column :is(p, ul, ol, table, .callout):not(figure *, .cell-output-display *)):not(:has(> .column:first-child > p:only-child > img:only-child):has(> .column:last-child > p:only-child > img:only-child)) {
flex-direction: column;
gap: 0;
> .column {
width: 100% !important;
}
> .column + .column > :first-child {
margin-top: 0;
}
}
table:not(.data-frame *) {
display: block;
width: fit-content;
max-width: 100%;
overflow-x: auto;
}
p:has(> math, > span.math.display) {
overflow-x: auto;
overflow-y: hidden;
}
table:not(.callout *, .data-frame *) {
max-width: calc(100% + 1.25rem);
}
p:has(> math, > span.math.display):not(.callout *) {
margin-right: -1.25rem;
padding-right: 1.25rem;
}
:is(table:not(.data-frame *), p:has(> math, > span.math.display)) {
--bs-table-bg: transparent; // cell backgrounds would hide the shadow
background:
linear-gradient(to right, var(--bs-body-bg) 40%, transparent) left center / 1.5rem 100% no-repeat local,
linear-gradient(to left, var(--bs-body-bg) 40%, transparent) right center / 1.5rem 100% no-repeat local,
radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--bs-body-color) 25%, transparent), transparent) left 1px center / 0.45rem 100% no-repeat scroll,
radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--bs-body-color) 25%, transparent), transparent) right 1px center / 0.45rem 100% no-repeat scroll;
}
:is(h1, h2, h3, h4) {
-webkit-hyphens: auto;
hyphens: auto;
}
}
img {
max-width: 100%;
height: auto;
}
.cell-output-display svg {
max-width: 100%;
height: auto;
}
}
// ── Responsive video embed ────────────────────────────────────────────────
// 16:9 iframe wrapper. Inert unless a lecture uses .video-wrapper.
.video-wrapper {
position: relative;
padding-bottom: 56.25%;
height: 0;
iframe {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
border: 0;
}
}
// Table captions: Bootstrap colours them with the secondary brand colour
// (sand), which reads as a warning and fails contrast on the light ground.
// Keep them in the body colour, slightly smaller, like figure captions.
caption,
.table > caption {
color: var(--bs-body-color);
font-size: 0.9em;
}
// Figure captions on pages: Quarto's caption rule gives them the same sand
// (about 1.4:1 on the light ground, e.g. under two graphs side by side). Body
// colour; their size stays Quarto's. Slides keep reveal's caption grey.
body:not(.reveal-viewport) :is(.panel-caption, .figure-caption, .subfigure-caption, .table-caption, figcaption) {
color: var(--bs-body-color);
}
// Gamekit and the course chat button share the bottom right corner: the chat
// button makes way on a game's own phone page and while a game's buttons sit
// in that corner (Gamekit >= 0.5.2 sets gamekit-at-bottom on <html>). It
// disappears without a transition, the same both ways and without motion.
body:has(.gamekit-solo) .cw-fab,
html.gamekit-at-bottom .cw-fab {
display: none !important;
}
// Document blockquotes: Quarto colours blockquote text with the secondary brand
// colour (sand) too, which lands near 1.4:1 on the light ground and is unreadable
// (the emphasis inside inherits it, since only `.reveal em` carries a colour).
// Same fix as captions: body colour; the left border and italic still mark it as
// a quote. Quarto sets the colour on the class `.blockquote`, so the element
// alone loses to it. Doc only; slide blockquotes do not carry the class.
blockquote.blockquote {
color: var(--bs-body-color);
}
// Inline code, see $lec-code-inline. Both modes: the dark layer swaps the
// variable.
:not(pre) > code:not(.sourceCode) {
color: $lec-code-inline;
}
// Inline code in a heading, a footnote or a callout title takes the text's
// colour. Quarto sets h3 and the footnote list to 90 % opacity and the callout
// header to 75 %, which pulled teal inline code under 4.5:1 on its chip
// (Introduction-to-Python's cheatsheet and FAQ: 4.23:1; Materiallogistik's
// footnotes: 3.81:1; Grundlagen-OR's callout titles: 2.89:1).
:is(h1, h2, h3, h4, h5, h6) > code:not(.sourceCode),
.footnotes code:not(.sourceCode),
.callout-header code:not(.sourceCode) {
color: inherit;
}
// A link or a coloured text class in a callout title keeps full strength: at
// the header's 75 % the link red fell to 4.23:1 (Study-Business-Basics' index
// cards). `div.` ties with Quarto's `.callout.callout-style-simple >
// div.callout-header { opacity: 75% }`, and this rule comes later in the bundle.
div.callout-header:has(.callout-title-container :is(a, .highlight, .errors, .task, .question)) {
opacity: 1;
}
// ANSI output, see $lec-ansi. Scoped to .ansi-escaped-output so it outranks
// Quarto's own notebook colours whatever order the layers come in.
@each $hue, $pair in $lec-ansi {
.ansi-escaped-output .ansi-#{$hue}-fg { color: nth($pair, 1); }
.ansi-escaped-output :is(.ansi-bright-#{$hue}-fg, .ansi-#{$hue}-intense-#{$hue}) { color: nth($pair, 2); }
}
.ansi-escaped-output .ansi-bright-black-fg {
color: $lec-ansi-grey;
}
// Backgrounds after every foreground, so a span with both classes takes the
// on-colour text whatever its hues.
@each $hue, $pair in $lec-ansi {
.ansi-escaped-output .ansi-#{$hue}-bg { background-color: nth($pair, 1); color: $lec-ansi-on-colour; }
.ansi-escaped-output .ansi-bright-#{$hue}-bg { background-color: nth($pair, 2); color: $lec-ansi-on-colour; }
}
// IPython writes 256-colour codes as inline styles. The one in use (colour
// 28, a green; 3.9:1 on the dark ground) follows the palette's green.
.ansi-escaped-output span[style*="rgb(0,135,0)"]:not([class*="-bg"]) {
color: nth(map-get($lec-ansi, green), 1) !important;
}
// A span with an ANSI background keeps readable text, also when IPython set
// an inline colour on it (a green on the yellow error marker: 1.1:1).
.ansi-escaped-output [class*="-bg"][style*="color"] {
color: $lec-ansi-on-colour !important;
}
// Line numbers (code-line-numbers) are link anchors; without this they take the link colour.
pre.numberSource code > span > a:first-child::before {
color: $lec-line-number;
}
// Light/dark toggle: a moon in light mode and a sun in dark mode (the mode a
// click switches to), from the Bootstrap Icons font every site loads, in the
// text colour and the link colour on hover. Replaces Quarto's 16px switch,
// which read as a faint grey pill next to the logo.
.quarto-color-scheme-toggle .bi::before {
background-image: none !important;
width: auto !important;
height: auto !important;
font-family: "bootstrap-icons" !important;
font-size: 1.35rem;
line-height: 1;
vertical-align: -0.15em;
color: var(--bs-body-color);
}
.quarto-color-scheme-toggle:is(:hover, :focus-visible) .bi::before {
color: var(--bs-link-color);
}
body.quarto-light .quarto-color-scheme-toggle .bi::before {
content: "\f497"; // bi-moon
content: "\f497" / ""; // no alt text: the link's title stays its name
}
body.quarto-dark .quarto-color-scheme-toggle .bi::before {
content: "\f5a2"; // bi-sun
content: "\f5a2" / "";
}
// Plots on a dark page: the courses' plot helpers draw on a transparent
// background in the brand's dark text, which vanishes on the dark ground. Every
// image a code cell produces (also in a `layout` panel, which has no
// .cell-output-display) sits on the light page colour as a card, as opaque
// figures already do. A hand-made transparent diagram opts in with
// `{.light-card}`. Later, maybe: a dark rendering per plot (Quarto's
// `renderings: [light, dark]`).
body.quarto-dark :is(div.cell img, img.light-card) {
background-color: $pi-light-ground;
border-radius: 6px;
}
// QR codes (transparent, dark modules: `assets/qr/`, `images/*-qr.svg`) turn
// white on a dark page; scanners read them inverted. Keep them out of the card
// above (a code cell, `.light-card`): white on it would vanish. Decks stay
// light and keep the dark modules.
body.quarto-dark img:is([src*="/qr/"], [src*="-qr."]) {
filter: brightness(0) invert(1);
}
// Search hits on a dark page sit on a dark fill ($mark-bg in _dark.scss), but
// the browser paints <mark> text black (2.0:1 there). They take the text's own
// colour: body text 7.6:1, links 5.6:1. Light mode keeps the black.
body.quarto-dark mark {
color: inherit;
}
// Footer, slide number, blockquotes and asides on a light slide: everything
// Quarto sets in its slide grey. On a dark background colour reveal flags the
// deck (`.reveal.has-dark-background`); there they keep Quarto's lighter grey,
// which is 5.9:1 on black where the darker one would be 4.4:1.
.reveal:not(.has-dark-background) .footer,
.reveal:not(.has-dark-background) .slide-number,
.reveal:not(.has-dark-background) blockquote,
.reveal:not(.has-dark-background) .slide aside,
.reveal:not(.has-dark-background) .slide div.aside {
color: $lec-slide-muted;
}
// Footer and slide number while a `.loud-slide` is showing. Both belong to the
// deck, not to the slide, so the slide's colours never reached them: the grey
// above is 1.08:1 on the accent ground and the link red 1.68:1. They take the
// slide's own light text colour, 4.36:1, the most this ground allows. A slide
// in a stack that is not showing keeps its `.present`, so the stack is checked
// as well. The printed deck gets the same from create_pdf.py (`on-dark-bg`).
.reveal:has(.slides > section.present.loud-slide,
.slides > section.present > section.present.loud-slide) {
.footer, .footer a:any-link, .slide-number {
color: $brand-lighter;
}
// The menu icon is an SVG with the link red painted in (1.68:1 here), so
// `color` does not reach it; the filter turns it white.
.slide-menu-button .fa-bars::before {
filter: brightness(0) invert(1);
}
}
// Document pages without a TOC (quizzes, exams with `toc: false`) get Quarto's
// `fullcontent` grid, which drops the right margin column and centres the body,
// so the text jumps right compared with every page that has a TOC. Give those
// pages the same grid as TOC pages; the margin column simply stays empty.
// Values copied from Quarto's `body.floating .page-columns` per breakpoint.
@media (min-width: 992px) {
body.floating.fullcontent .page-columns {
grid-template-columns: [screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end];
}
}
@media (max-width: 991.98px) and (min-width: 768px) {
body.floating.fullcontent .page-columns {
grid-template-columns: [screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end];
}
}
/* ─────────────────────────────────────────────────────────────────────────
LOCAL — rules specific to this lecture.
Everything ABOVE this line is generated from Lecture-Foundations/brand/
_core.scss by scripts/sync-core-scss.py. Edit it there, not here.
Everything BELOW is yours and is preserved across syncs.
───────────────────────────────────────────────────────────────────────── */