` * attributes, the colour scheme and the stylesheet linked after the panel's. */ final readonly class ThemeDocument { /** * @param list $chain * @param array $settings * @param array $tokens custom property => escaped CSS value * @param array $attributes data attribute => unescaped value * @param 'dark'|'light' $scheme * @param non-empty-list<'dark'|'light'> $schemes */ public function __construct( public string $id = ThemeRepository::CLASSIC, public array $chain = [], public array $settings = [], public array $tokens = [], public array $attributes = [], public string $scheme = 'dark', public array $schemes = ThemeRepository::CLASSIC_SCHEMES, public bool $systemScheme = false, public bool $safeMode = false, public bool $preview = false, public ?string $stylesheet = null, ) {} /** * `window.SiteConfiguration.theme`, sent to guests and signed-in users alike. * * @return array */ public function bootstrap(): array { return [ 'id' => $this->id, 'chain' => $this->chain, 'settings' => (object) $this->settings, 'scheme' => $this->scheme, 'schemes' => $this->schemes, 'safeMode' => $this->safeMode, 'preview' => $this->preview, ]; } /** @return array the attributes of `` besides `lang` */ public function htmlAttributes(): array { return ['class' => $this->scheme, 'data-theme' => $this->id, ...$this->attributes]; } /** The rule for `