fresh/view/theme/mod.rs
1//! Theme module with separated pure types and I/O operations.
2//!
3//! This module is split into:
4//! - `types`: Pure data types (WASM-compatible, no filesystem access)
5//! - `loader`: ThemeLoader creates ThemeRegistry from embedded + user themes (runtime only)
6//!
7//! # Example
8//!
9//! ```ignore
10//! use crate::view::theme::{Theme, ThemeLoader, ThemeRegistry};
11//! use std::path::PathBuf;
12//!
13//! // Load all themes once at startup (requires themes directory path)
14//! let themes_dir = PathBuf::from("/home/user/.config/fresh/themes");
15//! let loader = ThemeLoader::new(themes_dir);
16//! let registry = loader.load_all();
17//!
18//! // Or load embedded themes only (no user themes)
19//! let loader = ThemeLoader::embedded_only();
20//! let registry = loader.load_all();
21//!
22//! // Get theme by name (no I/O, just lookup)
23//! let dark = registry.get("dark").unwrap();
24//!
25//! // List all available themes
26//! let themes = registry.list();
27//! ```
28
29// Loader requires filesystem access - runtime only
30#[cfg(feature = "runtime")]
31mod loader;
32mod types;
33
34// Re-export all public items for backward compatibility
35#[cfg(feature = "runtime")]
36pub use loader::*;
37pub use types::*;