add toast
This commit is contained in:
@@ -10,6 +10,8 @@ pub struct Ramps {
|
||||
pub primary: AccentShades,
|
||||
pub secondary: AccentShades,
|
||||
pub destructive: AccentShades,
|
||||
pub success: AccentShades,
|
||||
pub warning: AccentShades,
|
||||
}
|
||||
|
||||
/// Everything a component paints from, after the overlay chain.
|
||||
@@ -58,6 +60,16 @@ pub(crate) fn resolve(
|
||||
system_palette.destructive,
|
||||
base.destructive,
|
||||
);
|
||||
let success = pick(
|
||||
def_color(|d| d.success()),
|
||||
system_palette.success,
|
||||
base.success,
|
||||
);
|
||||
let warning = pick(
|
||||
def_color(|d| d.warning()),
|
||||
system_palette.warning,
|
||||
base.warning,
|
||||
);
|
||||
|
||||
let mut colors = ColorTokens {
|
||||
background: pick(
|
||||
@@ -114,6 +126,18 @@ pub(crate) fn resolve(
|
||||
None,
|
||||
contrast_foreground(destructive),
|
||||
),
|
||||
success: pick(def_color(|d| d.success()), None, base.success),
|
||||
success_foreground: pick(
|
||||
def_color(|d| d.success_foreground()),
|
||||
None,
|
||||
contrast_foreground(success),
|
||||
),
|
||||
warning: pick(def_color(|d| d.warning()), None, base.warning),
|
||||
warning_foreground: pick(
|
||||
def_color(|d| d.warning_foreground()),
|
||||
None,
|
||||
contrast_foreground(warning),
|
||||
),
|
||||
border: pick(
|
||||
def_color(|d| d.border()),
|
||||
system_palette.border,
|
||||
@@ -182,6 +206,8 @@ pub(crate) fn resolve(
|
||||
colors.background,
|
||||
variant == ThemeVariant::Dark,
|
||||
),
|
||||
success: derive_shades(success, colors.background, variant == ThemeVariant::Dark),
|
||||
warning: derive_shades(warning, colors.background, variant == ThemeVariant::Dark),
|
||||
},
|
||||
colors,
|
||||
radius,
|
||||
|
||||
Reference in New Issue
Block a user