ThemeConfig
Type-safe theming on top of a stock reveal.js theme, configured via the customTheme {} block inside PresentationConfig (globally or per presentation, cascading like every other config).
Each typed property maps to one of the CSS custom properties (--r-*) that reveal.js themes expose; only the properties actually assigned are emitted, as a <style id="custom-theme"> override block layered after the base theme's stylesheet. No SCSS compilation is involved.
presentationConfig {
customTheme {
baseTheme = PresentationTheme.WHITE
mainColor = Color("#1a1a2e")
headingTextTransform = TextTransform.none
logo("assets/logo.svg", position = LogoPosition.TOP_RIGHT, size = 80.px)
}
}For the reveal.js theme variables the DSL does not model (--r-heading-margin, --r-heading1-text-shadow, …), use the customProperty passthrough.
Properties
Slide background color (--r-background-color).
The stock reveal.js theme these overrides layer on top of. When set, it takes precedence over PresentationConfig.theme for this presentation (and drives dark/light-derived behavior such as the Mermaid theme).
Vertical margin between block elements (--r-block-margin); stock themes use 20.px.
<h1> size (--r-heading1-size); stock themes use em values, e.g. 2.5.em.
<h2> size (--r-heading2-size).
<h3> size (--r-heading3-size).
<h4> size (--r-heading4-size).
Heading text color (--r-heading-color).
Heading font stack (--r-heading-font).
Heading font weight (--r-heading-font-weight), e.g. 600.
Heading text transform (--r-heading-text-transform). Most stock themes default to uppercase; set TextTransform.none to keep headings as written.
Link hover color (--r-link-color-hover).
Base font size (--r-main-font-size); reveal.js stock themes use 42.px.
Text-selection background color (--r-selection-background-color).
Text-selection foreground color (--r-selection-color).
Functions
Set a raw reveal.js theme variable the DSL does not model, e.g. customProperty("--r-heading-letter-spacing", "0.05em"). Values are emitted verbatim into the override block and cascade per property name like the typed ones.
Set a raw reveal.js config option by key for options kslides does not expose as a typed property (e.g. the menu plugin's themes array). The value is emitted verbatim into the Reveal.initialize({...}) call and participates in the config cascade like any other option. Prefer the typed properties where they exist.