diff --git a/pagetop/src/base/component/anchor.rs b/pagetop/src/base/component/anchor.rs index 4f021ce2..d157b942 100644 --- a/pagetop/src/base/component/anchor.rs +++ b/pagetop/src/base/component/anchor.rs @@ -28,10 +28,10 @@ type AnchorHtml = TypedComponent; pub struct Anchor { weight : Weight, renderable : Renderable, - id : IdentifierValue, - classes : Classes, + id : OptionId, + classes : OptionClasses, anchor_type: AnchorType, - href : AttributeValue, + href : OptionString, html : AnchorHtml, left_icon : AnchorIcon, right_icon : AnchorIcon, @@ -85,18 +85,18 @@ impl ComponentTrait for Anchor { } impl Anchor { - pub fn link(href: &str, html: L10n) -> Self { + pub fn link(href: impl Into, html: L10n) -> Self { Anchor::new().with_href(href).with_html(html) } - pub fn button(href: &str, html: L10n) -> Self { + pub fn button(href: impl Into, html: L10n) -> Self { Anchor::new() .with_type(AnchorType::Button) .with_href(href) .with_html(html) } - pub fn location(id: &str) -> Self { + pub fn location(id: impl Into) -> Self { Anchor::new().with_type(AnchorType::Location).with_id(id) } @@ -115,7 +115,7 @@ impl Anchor { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -140,7 +140,7 @@ impl Anchor { } #[fn_builder] - pub fn alter_href(&mut self, href: &str) -> &mut Self { + pub fn alter_href(&mut self, href: impl Into) -> &mut Self { self.href.alter_value(href); self } @@ -177,7 +177,7 @@ impl Anchor { // Anchor GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } @@ -185,7 +185,7 @@ impl Anchor { &self.anchor_type } - pub fn href(&self) -> &AttributeValue { + pub fn href(&self) -> &OptionString { &self.href } diff --git a/pagetop/src/base/component/block.rs b/pagetop/src/base/component/block.rs index f83ff261..ab3b1370 100644 --- a/pagetop/src/base/component/block.rs +++ b/pagetop/src/base/component/block.rs @@ -4,14 +4,16 @@ new_handle!(COMPONENT_BLOCK); actions_for_component!(Block); +type BlockTitle = TypedComponent; + #[rustfmt::skip] #[derive(Default)] pub struct Block { weight : Weight, renderable: Renderable, - id : IdentifierValue, - classes : Classes, - title : AttributeValue, + id : OptionId, + classes : OptionClasses, + title : BlockTitle, stuff : ArcComponents, template : String, } @@ -45,7 +47,7 @@ impl ComponentTrait for Block { let id = cx.required_id::(self.id()); PrepareMarkup::With(html! { div id=(id) class=[self.classes().get()] { - @if let Some(title) = self.title().get() { + @if let Some(title) = self.title().get().into_string(cx) { h2 class="block-title" { (title) } } div class="block-body" { @@ -64,7 +66,7 @@ impl Block { // Block BUILDER. #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -88,8 +90,8 @@ impl Block { } #[fn_builder] - pub fn alter_title(&mut self, title: &str) -> &mut Self { - self.title.alter_value(title); + pub fn alter_title(&mut self, title: L10n) -> &mut Self { + self.title.set(title); self } @@ -112,11 +114,11 @@ impl Block { // Block GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } - pub fn title(&self) -> &AttributeValue { + pub fn title(&self) -> &BlockTitle { &self.title } diff --git a/pagetop/src/base/component/form_element/button.rs b/pagetop/src/base/component/form_element/button.rs index ee869382..94b422dd 100644 --- a/pagetop/src/base/component/form_element/button.rs +++ b/pagetop/src/base/component/form_element/button.rs @@ -17,12 +17,12 @@ type ButtonValue = TypedComponent; pub struct Button { weight : Weight, renderable : Renderable, - classes : Classes, + classes : OptionClasses, button_type: ButtonType, - name : AttributeValue, + name : OptionString, value : ButtonValue, - autofocus : AttributeValue, - disabled : AttributeValue, + autofocus : OptionString, + disabled : OptionString, template : String, } @@ -146,7 +146,7 @@ impl Button { // Button GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } @@ -154,7 +154,7 @@ impl Button { &self.button_type } - pub fn name(&self) -> &AttributeValue { + pub fn name(&self) -> &OptionString { &self.name } @@ -162,11 +162,11 @@ impl Button { &self.value } - pub fn autofocus(&self) -> &AttributeValue { + pub fn autofocus(&self) -> &OptionString { &self.autofocus } - pub fn disabled(&self) -> &AttributeValue { + pub fn disabled(&self) -> &OptionString { &self.disabled } diff --git a/pagetop/src/base/component/form_element/date.rs b/pagetop/src/base/component/form_element/date.rs index 17e70845..f9b71c89 100644 --- a/pagetop/src/base/component/form_element/date.rs +++ b/pagetop/src/base/component/form_element/date.rs @@ -7,17 +7,17 @@ new_handle!(COMPONENT_DATE); pub struct Date { weight : Weight, renderable : Renderable, - classes : Classes, - name : AttributeValue, - value : AttributeValue, - label : AttributeValue, - placeholder : AttributeValue, - autofocus : AttributeValue, - autocomplete: AttributeValue, - disabled : AttributeValue, - readonly : AttributeValue, - required : AttributeValue, - help_text : AttributeValue, + classes : OptionClasses, + name : OptionString, + value : OptionString, + label : OptionString, + placeholder : OptionString, + autofocus : OptionString, + autocomplete: OptionString, + disabled : OptionString, + readonly : OptionString, + required : OptionString, + help_text : OptionString, template : String, } @@ -176,47 +176,47 @@ impl Date { // Date GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } - pub fn name(&self) -> &AttributeValue { + pub fn name(&self) -> &OptionString { &self.name } - pub fn value(&self) -> &AttributeValue { + pub fn value(&self) -> &OptionString { &self.value } - pub fn label(&self) -> &AttributeValue { + pub fn label(&self) -> &OptionString { &self.label } - pub fn placeholder(&self) -> &AttributeValue { + pub fn placeholder(&self) -> &OptionString { &self.placeholder } - pub fn autofocus(&self) -> &AttributeValue { + pub fn autofocus(&self) -> &OptionString { &self.autofocus } - pub fn autocomplete(&self) -> &AttributeValue { + pub fn autocomplete(&self) -> &OptionString { &self.autocomplete } - pub fn disabled(&self) -> &AttributeValue { + pub fn disabled(&self) -> &OptionString { &self.disabled } - pub fn readonly(&self) -> &AttributeValue { + pub fn readonly(&self) -> &OptionString { &self.readonly } - pub fn required(&self) -> &AttributeValue { + pub fn required(&self) -> &OptionString { &self.required } - pub fn help_text(&self) -> &AttributeValue { + pub fn help_text(&self) -> &OptionString { &self.help_text } diff --git a/pagetop/src/base/component/form_element/form.rs b/pagetop/src/base/component/form_element/form.rs index f4da8da7..3767d0b7 100644 --- a/pagetop/src/base/component/form_element/form.rs +++ b/pagetop/src/base/component/form_element/form.rs @@ -16,10 +16,10 @@ pub enum FormMethod { pub struct Form { weight : Weight, renderable: Renderable, - id : IdentifierValue, - classes : Classes, - action : AttributeValue, - charset : AttributeValue, + id : OptionId, + classes : OptionClasses, + action : OptionString, + charset : OptionString, method : FormMethod, stuff : ArcComponents, template : String, @@ -91,7 +91,7 @@ impl Form { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -139,15 +139,15 @@ impl Form { // Form GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } - pub fn action(&self) -> &AttributeValue { + pub fn action(&self) -> &OptionString { &self.action } - pub fn charset(&self) -> &AttributeValue { + pub fn charset(&self) -> &OptionString { &self.charset } diff --git a/pagetop/src/base/component/form_element/hidden.rs b/pagetop/src/base/component/form_element/hidden.rs index 79264c01..25807a45 100644 --- a/pagetop/src/base/component/form_element/hidden.rs +++ b/pagetop/src/base/component/form_element/hidden.rs @@ -6,8 +6,8 @@ new_handle!(COMPONENT_HIDDEN); #[derive(Default)] pub struct Hidden { weight: Weight, - name : NameValue, - value : AttributeValue, + name : OptionName, + value : OptionString, } impl ComponentTrait for Hidden { @@ -58,11 +58,11 @@ impl Hidden { // Hidden GETTERS. - pub fn name(&self) -> &NameValue { + pub fn name(&self) -> &OptionName { &self.name } - pub fn value(&self) -> &AttributeValue { + pub fn value(&self) -> &OptionString { &self.value } } diff --git a/pagetop/src/base/component/form_element/input.rs b/pagetop/src/base/component/form_element/input.rs index 7a06dda5..00595fe3 100644 --- a/pagetop/src/base/component/form_element/input.rs +++ b/pagetop/src/base/component/form_element/input.rs @@ -21,20 +21,20 @@ type InputHelpText = TypedComponent; pub struct Input { weight : Weight, renderable : Renderable, - classes : Classes, + classes : OptionClasses, input_type : InputType, - name : NameValue, - value : AttributeValue, + name : OptionName, + value : OptionString, label : InputLabel, size : Option, minlength : Option, maxlength : Option, - placeholder : AttributeValue, - autofocus : AttributeValue, - autocomplete: AttributeValue, - disabled : AttributeValue, - readonly : AttributeValue, - required : AttributeValue, + placeholder : OptionString, + autofocus : OptionString, + autocomplete: OptionString, + disabled : OptionString, + readonly : OptionString, + required : OptionString, help_text : InputHelpText, template : String, } @@ -282,7 +282,7 @@ impl Input { // Input GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } @@ -290,11 +290,11 @@ impl Input { &self.input_type } - pub fn name(&self) -> &NameValue { + pub fn name(&self) -> &OptionName { &self.name } - pub fn value(&self) -> &AttributeValue { + pub fn value(&self) -> &OptionString { &self.value } @@ -314,27 +314,27 @@ impl Input { self.maxlength } - pub fn placeholder(&self) -> &AttributeValue { + pub fn placeholder(&self) -> &OptionString { &self.placeholder } - pub fn autofocus(&self) -> &AttributeValue { + pub fn autofocus(&self) -> &OptionString { &self.autofocus } - pub fn autocomplete(&self) -> &AttributeValue { + pub fn autocomplete(&self) -> &OptionString { &self.autocomplete } - pub fn disabled(&self) -> &AttributeValue { + pub fn disabled(&self) -> &OptionString { &self.disabled } - pub fn readonly(&self) -> &AttributeValue { + pub fn readonly(&self) -> &OptionString { &self.readonly } - pub fn required(&self) -> &AttributeValue { + pub fn required(&self) -> &OptionString { &self.required } diff --git a/pagetop/src/base/component/heading.rs b/pagetop/src/base/component/heading.rs index 3b87dd5e..3c07bb51 100644 --- a/pagetop/src/base/component/heading.rs +++ b/pagetop/src/base/component/heading.rs @@ -32,8 +32,8 @@ type HeadingText = TypedComponent; pub struct Heading { weight : Weight, renderable : Renderable, - id : IdentifierValue, - classes : Classes, + id : OptionId, + classes : OptionClasses, heading_type: HeadingType, text : HeadingText, display : HeadingDisplay, @@ -127,7 +127,7 @@ impl Heading { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -177,7 +177,7 @@ impl Heading { // Paragraph GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } diff --git a/pagetop/src/base/component/icon.rs b/pagetop/src/base/component/icon.rs index 0b45ea08..a90a70e3 100644 --- a/pagetop/src/base/component/icon.rs +++ b/pagetop/src/base/component/icon.rs @@ -8,7 +8,7 @@ pub struct Icon { weight : Weight, renderable: Renderable, icon_name : String, - classes : Classes, + classes : OptionClasses, } impl ComponentTrait for Icon { @@ -73,7 +73,7 @@ impl Icon { self.icon_name.as_str() } - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } } diff --git a/pagetop/src/base/component/image.rs b/pagetop/src/base/component/image.rs index ddff8144..6cf1c632 100644 --- a/pagetop/src/base/component/image.rs +++ b/pagetop/src/base/component/image.rs @@ -20,9 +20,9 @@ pub enum ImageSize { pub struct Image { weight : Weight, renderable: Renderable, - id : IdentifierValue, - classes : Classes, - source : AttributeValue, + id : OptionId, + classes : OptionClasses, + source : OptionString, size : ImageSize, } @@ -101,7 +101,7 @@ impl Image { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -126,11 +126,11 @@ impl Image { // Image GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } - pub fn source(&self) -> &AttributeValue { + pub fn source(&self) -> &OptionString { &self.source } diff --git a/pagetop/src/base/component/paragraph.rs b/pagetop/src/base/component/paragraph.rs index b968140f..b51de2fa 100644 --- a/pagetop/src/base/component/paragraph.rs +++ b/pagetop/src/base/component/paragraph.rs @@ -18,8 +18,8 @@ pub enum ParagraphDisplay { pub struct Paragraph { weight : Weight, renderable: Renderable, - id : IdentifierValue, - classes : Classes, + id : OptionId, + classes : OptionClasses, stuff : ArcComponents, display : ParagraphDisplay, template : String, @@ -78,7 +78,7 @@ impl Paragraph { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -126,7 +126,7 @@ impl Paragraph { // Paragraph GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } diff --git a/pagetop/src/base/component/wrapper.rs b/pagetop/src/base/component/wrapper.rs index 339302fc..aa4d2e36 100644 --- a/pagetop/src/base/component/wrapper.rs +++ b/pagetop/src/base/component/wrapper.rs @@ -19,9 +19,9 @@ pub enum WrapperType { pub struct Wrapper { weight : Weight, renderable : Renderable, - id : IdentifierValue, - classes : Classes, - inner_classes: Classes, + id : OptionId, + classes : OptionClasses, + inner_classes: OptionClasses, wrapper_type : WrapperType, stuff : ArcComponents, template : String, @@ -137,7 +137,7 @@ impl Wrapper { } #[fn_builder] - pub fn alter_id(&mut self, id: &str) -> &mut Self { + pub fn alter_id(&mut self, id: impl Into) -> &mut Self { self.id.alter_value(id); self } @@ -173,11 +173,11 @@ impl Wrapper { // Wrapper GETTERS. - pub fn classes(&self) -> &Classes { + pub fn classes(&self) -> &OptionClasses { &self.classes } - pub fn inner_classes(&self) -> &Classes { + pub fn inner_classes(&self) -> &OptionClasses { &self.inner_classes } diff --git a/pagetop/src/html.rs b/pagetop/src/html.rs index 34cb7cdb..8e8e43ef 100644 --- a/pagetop/src/html.rs +++ b/pagetop/src/html.rs @@ -13,17 +13,17 @@ pub use assets::Assets; mod favicon; pub use favicon::Favicon; -mod identifier; -pub use identifier::IdentifierValue; +mod opt_id; +pub use opt_id::OptionId; -mod name; -pub use name::NameValue; +mod opt_name; +pub use opt_name::OptionName; -mod attribute; -pub use attribute::AttributeValue; +mod opt_string; +pub use opt_string::OptionString; -mod classes; -pub use classes::{Classes, ClassesOp}; +mod opt_classes; +pub use opt_classes::{ClassesOp, OptionClasses}; pub mod unit; @@ -45,7 +45,13 @@ impl PrepareMarkup { pub fn into_string(self) -> Option { match self { PrepareMarkup::None => None, - PrepareMarkup::Text(text) => Some(text.to_string()), + PrepareMarkup::Text(text) => { + if text.is_empty() { + None + } else { + Some(text.to_string()) + } + } PrepareMarkup::With(markup) => Some(markup.into_string()), } } diff --git a/pagetop/src/html/classes.rs b/pagetop/src/html/opt_classes.rs similarity index 79% rename from pagetop/src/html/classes.rs rename to pagetop/src/html/opt_classes.rs index c7fd6154..3be0c977 100644 --- a/pagetop/src/html/classes.rs +++ b/pagetop/src/html/opt_classes.rs @@ -1,4 +1,4 @@ -//! **Classes** implements a *helper* for dynamically adding class names to components. +//! **OptionClasses** implements a *helper* for dynamically adding class names to components. //! //! This *helper* differentiates between default classes (generally associated with styles provided //! by the theme) and user classes (for customizing components based on application styles). @@ -18,7 +18,9 @@ pub enum ClassesOp { Add, Remove, Replace(String), + Toggle, Reset, + Clear, } #[derive(Clone, PartialEq)] @@ -28,14 +30,14 @@ enum ClassType { } #[derive(Default)] -pub struct Classes(Vec<(String, ClassType)>); +pub struct OptionClasses(Vec<(String, ClassType)>); -impl Classes { +impl OptionClasses { pub fn new() -> Self { - Classes::default() + OptionClasses::default() } - // Classes BUILDER. + // OptionClasses BUILDER. #[fn_builder] pub fn alter_value(&mut self, op: ClassesOp, classes: impl Into) -> &mut Self { @@ -58,8 +60,8 @@ impl Classes { self.add(&classes, self.0.len(), ClassType::User); } ClassesOp::Remove => { - for name in classes { - self.0.retain(|(c, _)| c.ne(&name.to_string())); + for class in classes { + self.0.retain(|(c, _)| c.ne(&class.to_string())); } } ClassesOp::Replace(classes_to_replace) => { @@ -79,9 +81,23 @@ impl Classes { } self.add(&classes, pos, class_type); } + ClassesOp::Toggle => { + for class in classes { + if !class.is_empty() { + if let Some(pos) = self.0.iter().position(|(c, _)| c.eq(class)) { + self.0.remove(pos); + } else { + self.0.push((class.to_string(), ClassType::User)); + } + } + } + } ClassesOp::Reset => { self.0.retain(|(_, t)| t.ne(&ClassType::User)); } + ClassesOp::Clear => { + self.0.clear(); + } } self } @@ -96,7 +112,7 @@ impl Classes { } } - // Classes GETTERS. + // OptionClasses GETTERS. pub fn exists(&self, class: impl Into) -> bool { let class: String = class.into(); diff --git a/pagetop/src/html/name.rs b/pagetop/src/html/opt_id.rs similarity index 52% rename from pagetop/src/html/name.rs rename to pagetop/src/html/opt_id.rs index c3f2af12..fbc02f0d 100644 --- a/pagetop/src/html/name.rs +++ b/pagetop/src/html/opt_id.rs @@ -1,22 +1,22 @@ use crate::fn_builder; #[derive(Default)] -pub struct NameValue(String); +pub struct OptionId(String); -impl NameValue { +impl OptionId { pub fn new() -> Self { - NameValue::default() + OptionId::default() } - // NameValue BUILDER. + // OptionId BUILDER. #[fn_builder] - pub fn alter_value(&mut self, value: &str) -> &mut Self { - self.0 = value.trim().replace(' ', "_"); + pub fn alter_value(&mut self, value: impl Into) -> &mut Self { + self.0 = value.into().trim().replace(' ', "_"); self } - // NameValue GETTERS. + // OptionId GETTERS. pub fn get(&self) -> Option { if self.0.is_empty() { diff --git a/pagetop/src/html/attribute.rs b/pagetop/src/html/opt_name.rs similarity index 51% rename from pagetop/src/html/attribute.rs rename to pagetop/src/html/opt_name.rs index 965e8beb..1e811c33 100644 --- a/pagetop/src/html/attribute.rs +++ b/pagetop/src/html/opt_name.rs @@ -1,22 +1,22 @@ use crate::fn_builder; #[derive(Default)] -pub struct AttributeValue(String); +pub struct OptionName(String); -impl AttributeValue { +impl OptionName { pub fn new() -> Self { - AttributeValue::default() + OptionName::default() } - // AttributeValue BUILDER. + // OptionName BUILDER. #[fn_builder] - pub fn alter_value(&mut self, value: &str) -> &mut Self { - self.0 = value.trim().to_owned(); + pub fn alter_value(&mut self, value: impl Into) -> &mut Self { + self.0 = value.into().trim().replace(' ', "_"); self } - // AttributeValue GETTERS. + // OptionName GETTERS. pub fn get(&self) -> Option { if self.0.is_empty() { diff --git a/pagetop/src/html/identifier.rs b/pagetop/src/html/opt_string.rs similarity index 50% rename from pagetop/src/html/identifier.rs rename to pagetop/src/html/opt_string.rs index 90f8295b..aa872b3a 100644 --- a/pagetop/src/html/identifier.rs +++ b/pagetop/src/html/opt_string.rs @@ -1,22 +1,22 @@ use crate::fn_builder; #[derive(Default)] -pub struct IdentifierValue(String); +pub struct OptionString(String); -impl IdentifierValue { +impl OptionString { pub fn new() -> Self { - IdentifierValue::default() + OptionString::default() } - // IdentifierValue BUILDER. + // OptionString BUILDER. #[fn_builder] - pub fn alter_value(&mut self, value: &str) -> &mut Self { - self.0 = value.trim().replace(' ', "_"); + pub fn alter_value(&mut self, value: impl Into) -> &mut Self { + self.0 = value.into().trim().to_owned(); self } - // IdentifierValue GETTERS. + // OptionString GETTERS. pub fn get(&self) -> Option { if self.0.is_empty() { diff --git a/pagetop/src/response/page.rs b/pagetop/src/response/page.rs index 0425dbf0..e40ad2a7 100644 --- a/pagetop/src/response/page.rs +++ b/pagetop/src/response/page.rs @@ -3,7 +3,7 @@ use crate::base::component::L10n; use crate::core::component::{ArcComponent, ComponentTrait, TypedComponent}; use crate::core::component::{Context, ContextOp}; use crate::core::theme::ComponentsRegions; -use crate::html::{html, Classes, ClassesOp, Favicon, Markup, DOCTYPE}; +use crate::html::{html, ClassesOp, Favicon, Markup, OptionClasses, DOCTYPE}; use crate::response::fatal_error::FatalError; use crate::{fn_builder, service}; @@ -22,7 +22,7 @@ pub struct Page { properties : Vec<(&'static str, &'static str)>, favicon : Option, context : Context, - body_classes: Classes, + body_classes: OptionClasses, regions : ComponentsRegions, template : String, } @@ -37,7 +37,7 @@ impl Page { properties : Vec::new(), favicon : None, context : Context::new(request), - body_classes: Classes::new().with_value(ClassesOp::SetDefault, "body"), + body_classes: OptionClasses::new().with_value(ClassesOp::SetDefault, "body"), regions : ComponentsRegions::new(), template : "default".to_owned(), } @@ -125,7 +125,7 @@ impl Page { &mut self.context } - pub fn body_classes(&self) -> &Classes { + pub fn body_classes(&self) -> &OptionClasses { &self.body_classes }