Skip to main content

resolve_theme

Function resolve_theme 

Source
pub fn resolve_theme(
    platform_id: &str,
    content: &Content,
    global_config: &Config,
    profile_default_theme: Option<&str>,
    registry: &ThemeRegistry,
    fallback: &Theme,
) -> Theme
Expand description

Resolve theme using 5-level resolution chain (similar to RFC-0005’s published resolution):

  1. meta.toml[platforms.X].theme — per-content platform-specific
  2. meta.toml.theme — per-content default
  3. typub.toml[platforms.X].theme — global platform-specific
  4. typub.toml.theme — global default
  5. Profile default_theme — hardcoded in profiles.toml

Falls back to the provided fallback theme if no match at any layer.