Skip to main content

Crate typub_theme

Crate typub_theme 

Source
Expand description

Theme system for HTML output styling

Provides a unified theming system for all HTML-outputting platforms. Themes are CSS files that can be applied with or without inlining.

Themes are loaded in two layers:

  1. Builtins - Embedded at compile time from templates/themes/
  2. User themes - Loaded at runtime from user’s templates/themes/ directory

User themes with the same ID override builtins; new IDs extend the registry.

Structs§

Theme
A theme with its CSS content
ThemeRegistry
Registry of available themes

Constants§

BUILTIN_BASE_CSS
Base CSS applied to all themes.

Statics§

BUILTIN_PREVIEW_CSS
Built-in preview CSS files (platform_id, css_content).
BUILTIN_THEMES
Built-in theme CSS files (id, css_content).

Functions§

apply_theme
Apply theme to HTML body content.
apply_theme_full_document
Apply theme and wrap in full HTML document (for preview pages).
load_theme
Load a theme by ID from the registry, with fallback.
resolve_theme
Resolve theme using 5-level resolution chain (similar to RFC-0005’s published resolution):