Skip to content

Theming

The Reast Player uses CSS custom properties for visual customisation. Override them on the <reast-player> element or any ancestor.

Available Properties

Typography

PropertyDefaultDescription
--reast-font-bodyGeorgia, 'Times New Roman', serifBody text font family
--reast-font-headinginheritHeading font family
--reast-font-mono'Courier New', monospaceCode/raw block font
--reast-font-size1.125remBase font size
--reast-line-height1.7Base line height

Colours

PropertyDefault (light)Description
--reast-color-text#1a1a2ePrimary text colour
--reast-color-bg#ffffffBackground colour
--reast-color-accent#6c5ce7Accent colour (choices, links)
--reast-color-accent-hover#5a4bd4Accent hover state
--reast-color-muted#6b7280Secondary/muted text
--reast-color-border#e5e7ebBorder colour

Spacing

PropertyDefaultDescription
--reast-spacing-block1.5emVertical gap between blocks
--reast-spacing-inline1emHorizontal padding
--reast-max-width65chMaximum content width

Choices

PropertyDefaultDescription
--reast-choice-radius0.5remChoice button border radius
--reast-choice-padding0.75em 1.25emChoice button padding

Example: Dark Theme

css
reast-player {
  --reast-color-text: #e0e0e0;
  --reast-color-bg: #1a1a2e;
  --reast-color-accent: #a78bfa;
  --reast-color-accent-hover: #8b6ff0;
  --reast-color-muted: #9ca3af;
  --reast-color-border: #374151;
}

Example: Minimal Reader

css
reast-player {
  --reast-font-body: 'Literata', serif;
  --reast-font-size: 1.25rem;
  --reast-line-height: 1.8;
  --reast-max-width: 55ch;
  --reast-spacing-block: 2em;
}

Automatic Dark Mode

The player respects prefers-color-scheme by default. To force a specific theme, set the properties explicitly on the element.

Shadow DOM Boundary

The player renders inside Shadow DOM, so your page styles do not leak in. The only way to customise appearance is through these CSS custom properties. This guarantees visual consistency regardless of the host page's stylesheet.