add muted_hover token and rework tab strip visuals
This commit is contained in:
@@ -111,6 +111,11 @@ pub(crate) fn resolve(
|
||||
base.secondary_foreground,
|
||||
),
|
||||
muted: pick(def_color(|d| d.muted()), system_palette.muted, base.muted),
|
||||
muted_hover: pick(
|
||||
def_color(|d| d.muted_hover()),
|
||||
system_palette.muted_hover,
|
||||
base.muted_hover,
|
||||
),
|
||||
muted_foreground: pick(
|
||||
def_color(|d| d.muted_foreground()),
|
||||
system_palette.muted_foreground,
|
||||
@@ -601,4 +606,20 @@ mod tests {
|
||||
let preset_stated = resolve(&system(ThemeVariant::Dark, palette, None), Some(&def), None);
|
||||
assert_eq!(preset_stated.colors.info, hsla(0x0ea5e9));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn muted_hover_follows_the_overlay_chain() {
|
||||
// No platform states a hover wash; a preset or user file is the only
|
||||
// override above the neutral base.
|
||||
let palette = PartialPalette {
|
||||
muted_hover: Some(hsla(0x155e75)),
|
||||
..PartialPalette::default()
|
||||
};
|
||||
let stated = resolve(&system(ThemeVariant::Dark, palette, None), None, None);
|
||||
assert_eq!(stated.colors.muted_hover, hsla(0x155e75));
|
||||
|
||||
let def = ThemeDefinition::parse_toml("muted_hover = \"#0ea5e9\"\n").unwrap();
|
||||
let preset_stated = resolve(&system(ThemeVariant::Dark, palette, None), Some(&def), None);
|
||||
assert_eq!(preset_stated.colors.muted_hover, hsla(0x0ea5e9));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user