feat(slides): add persistent branding with per-slide visibility control

- Add branding overlays: logo, title, author, and footer text
- Use Reveal.js theme CSS variables for automatic color adaptation
- Inline SVGs for currentColor support on any theme
- Per-slide control via HTML comments:
  - <!-- no-branding -->: hide all elements
  - <!-- no-header -->: hide logo + title
  - <!-- no-footer -->: hide author + footer
- Fix body-level CSS selectors for proper visibility
- Add comprehensive documentation in example slides
This commit is contained in:
George Cushen committed 2026-01-13 15:36:32 +00:00
1 parent 1352d89867
commit aa9edea5df
16 files changed
+902 -17

No files matched your search

@@ -63,6 +63,30 @@ pluginOptions.plugins = enabledPlugins;
Reveal.initialize(pluginOptions);
// Handle data-state for branding visibility
// Apply classes to body since branding elements are body-level siblings of .reveal
const applySlideState = (event) => {
const body = document.body;
if (!body) return;
// Remove previous state classes from body
body.classList.remove("no-branding", "no-header", "no-footer");
// Get current slide's data-state
const currentSlide = event?.currentSlide || Reveal.getCurrentSlide();
if (currentSlide) {
const state = currentSlide.getAttribute("data-state");
if (state) {
state.split(" ").forEach((s) => {
body.classList.add(s);
});
}
}
};
Reveal.on("ready", applySlideState);
Reveal.on("slidechanged", applySlideState);
// Disable Mermaid by default.
if (typeof slides.diagram === "undefined") {
slides.diagram = false;