uf.themes#
Theme and styling support for uf.
Provides built-in themes, dark mode support, and theme customization.
Functions
Create HTML for theme toggle button. |
|
Generate JavaScript for theme toggling. |
|
|
Get a built-in theme by name. |
Classes
|
UI theme configuration. |
|
Configuration for theme system. |
- class uf.themes.Theme(name, colors=<factory>, fonts=<factory>, css='')[source]#
Bases:
objectUI theme configuration.
- name#
Theme name
- colors#
Color palette
- fonts#
Font configuration
- css#
Additional custom CSS
- class uf.themes.ThemeConfig(default_theme='light', allow_toggle=True, available_themes=None, custom_theme=None)[source]#
Bases:
objectConfiguration for theme system.
Example
>>> config = ThemeConfig( ... default_theme='dark', ... allow_toggle=True, ... available_themes=['light', 'dark', 'ocean'] ... )
- uf.themes.create_theme_toggle_button()[source]#
Create HTML for theme toggle button.
- Return type:
- Returns:
HTML string for theme toggle button