built_in_design
¶
available_themes = [(ThemeClass.model_fields['theme'].default) for ThemeClass in (get_args(get_args(BuiltInDesign.__value__)[0]))]
module-attribute
¶
built_in_design_adapter = pydantic.TypeAdapter(BuiltInDesign)
module-attribute
¶
BuiltInDesign = Annotated[ClassicTheme | reduce(or_, discover_other_themes()), pydantic.Field(discriminator=theme)]
¶
discover_other_themes()
¶
Auto-discover and load theme variant classes from other_themes/ directory.
Why
Built-in themes beyond classic are defined as YAML files with field overrides. Dynamic discovery and variant generation keeps theme system extensible without code changes for each theme.
Returns:
-
list[type[ClassicTheme]]–List of dynamically generated theme variant classes.