pub struct ThemeRegistry { /* private fields */ }Expand description
Registry of available themes
Implementations§
Source§impl ThemeRegistry
impl ThemeRegistry
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new registry with embedded builtins, overlaid with user themes.
- Start with builtin themes (embedded at compile time)
- Overlay user themes from
templates/themes/if directory exists - User themes with same ID override builtins; new IDs are added
Sourcepub fn get_or_default(&self, id: &str) -> Result<&Theme>
pub fn get_or_default(&self, id: &str) -> Result<&Theme>
Get a theme by ID, falling back to minimal
Sourcepub fn load_preview_css(&self, platform: &str) -> Option<String>
pub fn load_preview_css(&self, platform: &str) -> Option<String>
Load preview CSS for a specific adapter/platform.
Preview CSS files are named _preview-{platform}.css and provide
styling for the preview page (toolbar, copy button, container, etc.)
Resolution order:
- User’s
templates/themes/_preview-{platform}.css(if exists) - Builtin preview CSS (embedded at compile time)
Auto Trait Implementations§
impl Freeze for ThemeRegistry
impl RefUnwindSafe for ThemeRegistry
impl Send for ThemeRegistry
impl Sync for ThemeRegistry
impl Unpin for ThemeRegistry
impl UnsafeUnpin for ThemeRegistry
impl UnwindSafe for ThemeRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more