Añade definición de subtítulos en cabeceras
This commit is contained in:
parent
88a59780c3
commit
c5c3d1688e
3 changed files with 31 additions and 17 deletions
|
|
@ -11,6 +11,7 @@ pub enum HeadingDisplay {
|
||||||
Small,
|
Small,
|
||||||
XxSmall,
|
XxSmall,
|
||||||
Normal,
|
Normal,
|
||||||
|
Subtitle,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Heading {
|
pub struct Heading {
|
||||||
|
|
@ -180,6 +181,7 @@ impl Heading {
|
||||||
HeadingDisplay::Small => "display-5",
|
HeadingDisplay::Small => "display-5",
|
||||||
HeadingDisplay::XxSmall => "display-6",
|
HeadingDisplay::XxSmall => "display-6",
|
||||||
HeadingDisplay::Normal => "",
|
HeadingDisplay::Normal => "",
|
||||||
|
HeadingDisplay::Subtitle => "",
|
||||||
}, ClassesOp::SetDefault);
|
}, ClassesOp::SetDefault);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,20 @@ fn just_visiting() -> Container {
|
||||||
.with_spaces(&[SpaceSet::PaddingAll(SpaceValue::RelPct(2.0))])
|
.with_spaces(&[SpaceSet::PaddingAll(SpaceValue::RelPct(2.0))])
|
||||||
)
|
)
|
||||||
.with_column(grid::Column::new()
|
.with_column(grid::Column::new()
|
||||||
.with_component(Heading::h2(html! { (l("visiting_title")) }))
|
.with_component(Heading::h2(html! {
|
||||||
.with_component(Heading::h3(html! { (l("visiting_subtitle")) }))
|
(l("visiting_title"))
|
||||||
.with_component(Paragraph::with(html! { (l("visiting_text1")) }))
|
})
|
||||||
|
)
|
||||||
|
.with_component(Heading::h3(html! {
|
||||||
|
(l("visiting_subtitle"))
|
||||||
|
})
|
||||||
|
.with_display(HeadingDisplay::Subtitle)
|
||||||
|
)
|
||||||
|
.with_component(Paragraph::with(html! {
|
||||||
|
(l("visiting_text1"))
|
||||||
|
})
|
||||||
|
.with_display(ParagraphDisplay::Small)
|
||||||
|
)
|
||||||
.with_component(Paragraph::with(html! { (l("visiting_text2")) }))
|
.with_component(Paragraph::with(html! { (l("visiting_text2")) }))
|
||||||
.with_spaces(&[
|
.with_spaces(&[
|
||||||
SpaceSet::PaddingTop(SpaceValue::RelPct(2.5)),
|
SpaceSet::PaddingTop(SpaceValue::RelPct(2.5)),
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,15 @@ impl ThemeTrait for Bulmix {
|
||||||
},
|
},
|
||||||
HEADING_COMPONENT => {
|
HEADING_COMPONENT => {
|
||||||
let h = component_mut::<Heading>(component);
|
let h = component_mut::<Heading>(component);
|
||||||
h.alter_classes(concat_string!("title ", match h.display() {
|
h.alter_classes(match h.display() {
|
||||||
HeadingDisplay::XxLarge => "is-1",
|
HeadingDisplay::XxLarge => "title is-1",
|
||||||
HeadingDisplay::Large => "is-2",
|
HeadingDisplay::Large => "title is-2",
|
||||||
HeadingDisplay::Medium => "is-3",
|
HeadingDisplay::Medium => "title is-3",
|
||||||
HeadingDisplay::Small => "is-4",
|
HeadingDisplay::Small => "title is-4",
|
||||||
HeadingDisplay::XxSmall => "is-5",
|
HeadingDisplay::XxSmall => "title is-5",
|
||||||
HeadingDisplay::Normal => "",
|
HeadingDisplay::Normal => "title",
|
||||||
}).as_str(), ClassesOp::SetDefault);
|
HeadingDisplay::Subtitle => "subtitle",
|
||||||
|
}, ClassesOp::SetDefault);
|
||||||
},
|
},
|
||||||
PARAGRAPH_COMPONENT => {
|
PARAGRAPH_COMPONENT => {
|
||||||
let p = component_mut::<Paragraph>(component);
|
let p = component_mut::<Paragraph>(component);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue