Fix IDS theme heading and bar layout
The orange bar never reached the slide's top left corner and the headings
stayed centred, because several separate things were fighting:
- reveal.js keeps 4% of the display empty around the content (config
`margin`, default 0.04). No CSS inside the slide can escape that box.
Default it to 0 and add the breathing room back as slide padding.
- Draw the bar as two ::before segments, one on the title and one on the
subtitle, each sized as a percentage of its own heading box. The bar
then always ends at the bottom of the last heading, follows a wrapped
heading, and needs no fixed heights. Slides without a subtitle reserve
the room one would take, so the bar does not change height between
slides.
- Reaching the window's physical left edge needs viewport / scale, and
CSS cannot divide a length by a length. The template now publishes the
letter-/pillarbox bands as --ids-band-left / --ids-band-top and the bar
shifts out by that much; it falls back to 0px, which is already correct
whenever the deck and display aspect ratios agree.
- Headings rendered in a regular-weight, regular-width fallback because
korap.ids-mannheim.de/font/fira-condensed.css returns a 404 page rather
than CSS. Load Fira Sans Extra Condensed from Google Fonts, weight 700.
- Paint the bar as flat #f6a800. orange_bar.png is two-toned, so
stretching it over each segment left a pale seam where they met.
- Left-align body content with the heading text and put the IDS logo's
top on the heading's cap line.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I199cb4f0c3b766c0774351922d05f171fdbd4e79
diff --git a/R/revealjs_presentation.R b/R/revealjs_presentation.R
index 47f4073..7d8c082 100644
--- a/R/revealjs_presentation.R
+++ b/R/revealjs_presentation.R
@@ -216,6 +216,15 @@
# use history
args <- c(args, pandoc_variable_arg("history", "true"))
+ # The IDS corporate design puts the orange bar flush against the top left
+ # corner of the slide. reveal.js defaults to margin = 0.04, i.e. it keeps 4%
+ # of the display empty around the content, which would leave a white border
+ # above and to the left of the bar. Default to 0 instead, unless the document
+ # asks for a margin of its own via reveal_options.
+ if (!is.list(reveal_options) || is.null(reveal_options[["margin"]])) {
+ args <- c(args, pandoc_variable_arg("margin", "0"))
+ }
+
# additional reveal options
if (is.list(reveal_options)) {
for (option in names(reveal_options)) {