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.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var backgroundColor: Color

Slide background color (--r-background-color).

Link copied to clipboard

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).

Link copied to clipboard
var blockMargin: LinearDimension

Vertical margin between block elements (--r-block-margin); stock themes use 20.px.

Link copied to clipboard

Code font stack (--r-code-font), e.g. "JetBrains Mono, monospace".

Link copied to clipboard
var heading1Size: LinearDimension

<h1> size (--r-heading1-size); stock themes use em values, e.g. 2.5.em.

Link copied to clipboard
var heading2Size: LinearDimension

<h2> size (--r-heading2-size).

Link copied to clipboard
var heading3Size: LinearDimension

<h3> size (--r-heading3-size).

Link copied to clipboard
var heading4Size: LinearDimension

<h4> size (--r-heading4-size).

Link copied to clipboard
var headingColor: Color

Heading text color (--r-heading-color).

Link copied to clipboard

Heading font stack (--r-heading-font).

Link copied to clipboard

Heading font weight (--r-heading-font-weight), e.g. 600.

Link copied to clipboard
var headingTextTransform: TextTransform

Heading text transform (--r-heading-text-transform). Most stock themes default to uppercase; set TextTransform.none to keep headings as written.

Link copied to clipboard
var linkColor: Color

Link color (--r-link-color).

Link copied to clipboard
var linkColorHover: Color

Link hover color (--r-link-color-hover).

Link copied to clipboard
var mainColor: Color

Body text color (--r-main-color).

Link copied to clipboard

Body font stack (--r-main-font), e.g. "Inter, sans-serif".

Link copied to clipboard
var mainFontSize: LinearDimension

Base font size (--r-main-font-size); reveal.js stock themes use 42.px.

Link copied to clipboard

Text-selection background color (--r-selection-background-color).

Link copied to clipboard
var selectionColor: Color

Text-selection foreground color (--r-selection-color).

Functions

Link copied to clipboard
fun customProperty(name: String, value: String)

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.

Link copied to clipboard
fun logo(src: String, position: LogoPosition = LogoPosition.TOP_RIGHT, size: LinearDimension = 80.px, margin: LinearDimension = 16.px, opacity: Double = 1.0, href: String = "")

Pin a brand logo to a corner of every slide.

Link copied to clipboard
open override fun merge(other: AbstractConfig)

Merge other into this config in place: every entry from other's two maps is copied into this config's maps, with later puts overwriting earlier keys. This is how the global → presentation → slide cascade resolves (parent merged first, then child).

Link copied to clipboard
open fun revealjsOption(key: String, value: Any)

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.