Theming#

Color themes, runtime theme switching, and fonts. Declare a theme in code, switch the active theme at runtime, look up resolved theme colors, and adjust the application fonts. These names span two import paths — the two switch verbs are on the top-level compose surface (bootstack.set_theme), the rest live in bootstack.style — but they are one job, so the reference groups them together.

For task-oriented introductions see the Theming and Typography guides.

Theme switching#

Switch the active theme at runtime. Part of the top-level compose surface.

bootstack.set_theme

Set the active application theme.

bootstack.toggle_theme

Toggle the active application theme between light and dark mode.

Themes#

Declare a color theme in code, install it, and resolve color tokens against the active theme.

bootstack.style.Theme

A color theme family declared in code.

bootstack.style.get_theme

Return the name of the currently active theme.

bootstack.style.get_theme_color

Get a hex color value from a color token based on the active theme.

bootstack.style.get_themes

Return the list of all registered themes.

Fonts#

Inspect and adjust the application fonts at runtime.

bootstack.style.get_font_families

Return the installed UI font families available to the application.

bootstack.style.set_font_family

Set the application font family for all non-code text.

bootstack.style.update_font_token

Override the attributes of a single font token.

Type aliases#

type bootstack.style.ThemeMode#

Theme appearance mode — 'light' or 'dark'.