diff --git a/pagetop/src/base/component.rs b/pagetop/src/base/component.rs index a28aa3aa..65fa5b85 100644 --- a/pagetop/src/base/component.rs +++ b/pagetop/src/base/component.rs @@ -31,10 +31,6 @@ pub(crate) fn add_assets_for_base(cx: &mut Context) { JavaScript::at("/base/js/menu.js").with_version("0.0.1"), )); } - - cx.alter(ContextOp::AddStyleSheet( - StyleSheet::at("/base/css/styles.css").with_version("0.0.1"), - )); } // By default, 1 pixel = 0.0625em. diff --git a/pagetop/src/base/theme.rs b/pagetop/src/base/theme.rs index 7c75ca33..83216d03 100644 --- a/pagetop/src/base/theme.rs +++ b/pagetop/src/base/theme.rs @@ -1,2 +1,2 @@ mod inception; -pub use inception::{InceptionTheme, THEME_INCEPTION}; +pub use inception::{Inception, THEME_INCEPTION}; diff --git a/pagetop/src/base/theme/inception.rs b/pagetop/src/base/theme/inception.rs index 5eca9298..8e7b411a 100644 --- a/pagetop/src/base/theme/inception.rs +++ b/pagetop/src/base/theme/inception.rs @@ -4,9 +4,9 @@ new_handle!(THEME_INCEPTION); static_files!(base); -pub struct InceptionTheme; +pub struct Inception; -impl ModuleTrait for InceptionTheme { +impl ModuleTrait for Inception { fn handle(&self) -> Handle { THEME_INCEPTION } @@ -16,7 +16,7 @@ impl ModuleTrait for InceptionTheme { } fn theme(&self) -> Option { - Some(&InceptionTheme) + Some(&Inception) } fn configure_service(&self, scfg: &mut service::web::ServiceConfig) { @@ -24,7 +24,7 @@ impl ModuleTrait for InceptionTheme { } } -impl ThemeTrait for InceptionTheme { +impl ThemeTrait for Inception { fn after_prepare_body(&self, page: &mut Page) { page.alter_favicon(Some(Favicon::new().with_icon("/base/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( @@ -32,6 +32,9 @@ impl ThemeTrait for InceptionTheme { .with_version("8.0.1") .with_weight(-99), )) - .alter_context(ContextOp::AddAssetsForBase); + .alter_context(ContextOp::AddAssetsForBase) + .alter_context(ContextOp::AddStyleSheet( + StyleSheet::at("/base/css/styles.css").with_version("0.0.1"), + )); } } diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index 24c0ecb2..4e06deca 100644 --- a/pagetop/src/core/module/all.rs +++ b/pagetop/src/core/module/all.rs @@ -28,7 +28,7 @@ pub fn register_modules(app: ModuleRef) { let mut list: Vec = Vec::new(); // Enable default theme. - add_to_enabled(&mut list, &crate::base::theme::InceptionTheme); + add_to_enabled(&mut list, &crate::base::theme::Inception); // Enable application modules. add_to_enabled(&mut list, app); diff --git a/pagetop/src/core/theme/all.rs b/pagetop/src/core/theme/all.rs index 3283cc40..29f7c6f7 100644 --- a/pagetop/src/core/theme/all.rs +++ b/pagetop/src/core/theme/all.rs @@ -13,7 +13,7 @@ pub static THEMES: LazyStatic>> = LazyStatic::new(|| RwLock pub static THEME: LazyStatic = LazyStatic::new(|| match theme_by_single_name(&config::SETTINGS.app.theme) { Some(theme) => theme, - None => &crate::base::theme::InceptionTheme, + None => &crate::base::theme::Inception, }); // THEME BY NAME ***********************************************************************************