Añade componentes para enlaces

This commit is contained in:
Manuel Cillero 2022-05-13 16:25:11 +02:00
parent dda666e889
commit 075c546fd5
7 changed files with 338 additions and 81 deletions

View file

@ -5,11 +5,10 @@ pub const PARAGRAPH_COMPONENT: &str = "pagetop::component::paragraph";
pub enum ParagraphDisplay {
XxLarge,
Large,
MediumPlus,
Normal,
Medium,
Small,
XxSmall,
Normal,
}
pub struct Paragraph {
@ -123,18 +122,14 @@ impl Paragraph {
pub fn alter_display(&mut self, display: ParagraphDisplay) -> &mut Self {
self.display = display;
self.classes.alter(
match &self.display() {
ParagraphDisplay::XxLarge => "fs-1",
ParagraphDisplay::Large => "fs-2",
ParagraphDisplay::MediumPlus => "fs-3",
ParagraphDisplay::Normal => "",
ParagraphDisplay::Medium => "fs-4",
ParagraphDisplay::Small => "fs-5",
ParagraphDisplay::XxSmall => "fs-6",
},
ClassesOp::SetDefault
);
self.classes.alter(match &self.display() {
ParagraphDisplay::XxLarge => "fs-2",
ParagraphDisplay::Large => "fs-3",
ParagraphDisplay::Medium => "fs-4",
ParagraphDisplay::Small => "fs-5",
ParagraphDisplay::XxSmall => "fs-6",
ParagraphDisplay::Normal => "",
}, ClassesOp::SetDefault);
self
}