Add popular styles to buttons

This commit is contained in:
Manuel Cillero 2023-11-23 20:31:22 +01:00
parent 9f25695298
commit 8a797365e2
10 changed files with 799 additions and 651 deletions

View file

@ -106,6 +106,32 @@ impl ThemeTrait for Bootsier {
}
h if Button::matches_handle(h) => {
if let Some(b) = component_as_mut::<Button>(component) {
match b.style() {
ButtonStyle::Default => {
b.replace_classes(b.style().to_string(), "btn btn-primary");
}
ButtonStyle::Info => {
b.replace_classes(b.style().to_string(), "btn btn-info");
}
ButtonStyle::Success => {
b.replace_classes(b.style().to_string(), "btn btn-success");
}
ButtonStyle::Warning => {
b.replace_classes(b.style().to_string(), "btn btn-warning");
}
ButtonStyle::Danger => {
b.replace_classes(b.style().to_string(), "btn btn-danger");
}
ButtonStyle::Light => {
b.replace_classes(b.style().to_string(), "btn btn-light");
}
ButtonStyle::Dark => {
b.replace_classes(b.style().to_string(), "btn btn-dark");
}
ButtonStyle::Link => {
b.replace_classes(b.style().to_string(), "btn btn-link");
}
};
match b.font_size() {
FontSize::ExtraLarge => {
b.replace_classes(b.font_size().to_string(), "fs-1");
@ -124,14 +150,6 @@ impl ThemeTrait for Bootsier {
}
_ => {}
};
match b.button_type() {
ButtonType::Link => {
b.replace_classes(b.button_type().to_string(), "btn btn-link");
}
ButtonType::Primary => {
b.replace_classes(b.button_type().to_string(), "btn btn-primary");
}
};
}
}
h if Heading::matches_handle(h) => {