Skip Navigation
StructureStructure

ThemeConfiguration

Configuration for the documentation theme.

struct ThemeConfiguration

Mentioned in

Overview

A theme consists of three parts, all optional:

  1. Settings in the swift-docc-render theme-settings.json format, which define custom properties (colours, fonts, spacing) and feature switches;

  2. Stylesheets that are layered after the base stylesheet and can change any rule;

  3. Custom CSS supplied by the user, layered last.

Built-in themes are compiled into the binary; custom themes are read from a theme-settings.json file or from a theme directory containing that file and optional stylesheets.

Using Theme Settings

// Use a built-in theme
let classic = ThemeConfiguration(builtInTheme: .classic)

// Resolve a theme name, settings file or theme directory
let custom = try ThemeConfiguration.resolveTheme("MyTheme")

Topics

Relationships

  • Swift.Equatable
  • Swift.Sendable
  • Swift.SendableMetatype

See Also