♻️ (pagetop): Logotipo embebido y Badge en Intent
- `PageTopSvg::markup_with()` fusiona `Props` y controla la etiqueta accesible directamente en el `<svg>`. - `Image` ya no duplica accesibilidad para el logotipo y corrige el `alt` vacío en el resto de fuentes (Responsive/Thumbnail/Plain). - Sustituye `BadgeKind` y el `ColorName`/`IntoColor` de `core/theme` por un `Intent` compartido.
This commit is contained in:
parent
4ba66f5995
commit
e24b9ab9de
15 changed files with 199 additions and 187 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Badge.
|
||||
pub(crate) mod badge;
|
||||
pub use badge::{Badge, BadgeKind};
|
||||
pub use badge::Badge;
|
||||
|
||||
// Button.
|
||||
mod button;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
pub use pagetop::base::component::{Badge, BadgeKind};
|
||||
pub use pagetop::base::component::Badge;
|
||||
|
||||
// **< Badge SETUP >********************************************************************************
|
||||
|
||||
#[rustfmt::skip]
|
||||
pub(crate) fn setup(badge: &mut Badge) {
|
||||
let (old, new) = match badge.kind() {
|
||||
BadgeKind::Primary => ("badge-primary", "text-bg-primary"),
|
||||
BadgeKind::Secondary => ("badge-secondary", "text-bg-secondary"),
|
||||
BadgeKind::Success => ("badge-success", "text-bg-success"),
|
||||
BadgeKind::Info => ("badge-info", "text-bg-info"),
|
||||
BadgeKind::Warning => ("badge-warning", "text-bg-warning"),
|
||||
BadgeKind::Danger => ("badge-danger", "text-bg-danger"),
|
||||
};
|
||||
badge.alter_prop(PropsOp::replace_classes(old, new));
|
||||
let intent = badge.intent().as_str();
|
||||
|
||||
badge.alter_prop(PropsOp::replace_classes(
|
||||
util::join!("badge-", intent),
|
||||
util::join!("text-bg-", intent),
|
||||
));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue