teksilo_core/styles/snackbar_style.rs
1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! Tier-3 style protocol for `Snackbar`. See `docs/styling-system.md`.
5//!
6//! Themes the snackbar surface — the high-contrast notification panel
7//! that floats up from the bottom of the window. The `Snackbar`
8//! widget keeps its `Role::Alert` / `Live::Polite` accessibility node;
9//! `SnackbarStyle` only owns the surface chrome.
10
11use std::rc::Rc;
12
13use crate::build_context::BuildContext;
14use crate::widget_id::WidgetId;
15
16#[derive(Clone, Debug)]
17pub struct SnackbarStyleConfig {
18 /// Pre-built message + optional action subtree the surface wraps.
19 pub content: WidgetId,
20}
21
22pub trait SnackbarStyle: 'static {
23 fn make_body(&self, cfg: &SnackbarStyleConfig, ctx: &mut BuildContext) -> WidgetId;
24}
25
26pub type SharedSnackbarStyle = Rc<dyn SnackbarStyle>;