textiler-core 0.1.0

Provides the core utilities to get textiler to work
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::context::ThemeContext;
use crate::theme::Theme;
use yew::hook;

/// Use a theme
#[hook]
pub fn use_theme() -> Theme {
    let theme: Option<ThemeContext> = yew::use_context::<ThemeContext>();
    theme
        .map(|theme: ThemeContext| (*theme).clone())
        .unwrap_or_default()
}