ThemeBuilder
Description
Theme.Build() returns a ThemeBuilder, a fluent builder for every colour CSS variable the toolkit reads. Each setter takes a light value and a dark value, and Apply() writes them into a single <style> element, so one call themes both modes and switching mode afterwards needs nothing further. Variables you don't set keep their defaults from tss.common.css.
Use it to brand an app, match an existing design system or apply a per-tenant palette. For a single change such as the primary colour or the page background, Theme.SetPrimary(...), Theme.SetBackground(...) and Theme.SetHighlight(...) (Theme Colors) leave the rest of the palette alone.
Usage
Chain the setters you need and finish with .Apply(). A theme applied earlier is removed first, and Theme.ResetBuild() goes back to the defaults.
Primary, Danger, Warning and Success each set the background, its hover and active shades and the border together; Primary also sets the shadow, link and highlight colours, so chain Link(...) or Highlight(...) after it to give those their own values. The …Background, …Foreground, …Border setters change one piece. SetVariable(name, light, dark) covers a variable the typed setters don't, with the name given without the --tss- prefix. ToCss() returns the generated CSS without attaching it, for example to store a tenant's palette and re-apply it later.