Table of Contents

Class VelvetTheme

Namespace
Velvet
Assembly
Velvet.Docs.dll

Global theme state backing the dark: utility variant and the bundled stylesheet's dark token set. This models a class-based dark-mode strategy as a single application-wide flag rather than scanning for an ancestor .dark class (UI Toolkit has no class-change event to react to cheaply); BindThemeTo(VisualElement) projects the flag back onto that class for the roots the sheet is attached to, which is what selects the token set.

Set IsDark from your app (e.g. on a settings toggle); every mounted element with a dark: variant re-evaluates its payload when the value changes.

public static class VelvetTheme
Inheritance
object
VelvetTheme

Properties

IsDark

Whether dark mode is active. Setting it notifies DarkModeChanged.

Events

DarkModeChanged

Raised whenever IsDark changes.