diff --git a/crates/story/src/assets.rs b/crates/story/src/assets.rs index 8375203f..57ca5efd 100644 --- a/crates/story/src/assets.rs +++ b/crates/story/src/assets.rs @@ -1,4 +1,6 @@ -use anyhow::anyhow; +use std::borrow::Cow; + +use anyhow::{anyhow, Result}; use gpui::AssetSource; use rust_embed::RustEmbed; @@ -10,7 +12,11 @@ use rust_embed::RustEmbed; pub struct Assets; impl AssetSource for Assets { - fn load(&self, path: &str) -> gpui::Result>> { + fn load(&self, path: &str) -> Result>> { + if path.is_empty() { + return Ok(None); + } + Self::get(path) .map(|f| Some(f.data)) .ok_or_else(|| anyhow!("could not find asset at path \"{}\"", path)) diff --git a/crates/ui/src/button/button.rs b/crates/ui/src/button/button.rs index d78ee3a4..842d56f3 100644 --- a/crates/ui/src/button/button.rs +++ b/crates/ui/src/button/button.rs @@ -849,64 +849,22 @@ impl ButtonVariant { fn selected(&self, outline: bool, cx: &mut App) -> ButtonVariantStyle { let bg = match self { - ButtonVariant::Primary => { - if outline { - cx.theme().primary - } else { - cx.theme().primary_active - } - } - ButtonVariant::Secondary | ButtonVariant::Ghost => { - if outline { - cx.theme().secondary - } else { - cx.theme().secondary_active - } - } - ButtonVariant::Danger => { - if outline { - cx.theme().danger - } else { - cx.theme().danger_active - } - } - ButtonVariant::Warning => { - if outline { - cx.theme().warning - } else { - cx.theme().warning_active - } - } - ButtonVariant::Success => { - if outline { - cx.theme().success - } else { - cx.theme().success_active - } - } - ButtonVariant::Info => { - if outline { - cx.theme().info - } else { - cx.theme().info_active - } - } + ButtonVariant::Primary => cx.theme().primary_active, + ButtonVariant::Secondary | ButtonVariant::Ghost => cx.theme().secondary_active, + ButtonVariant::Danger => cx.theme().danger_active, + ButtonVariant::Warning => cx.theme().warning_active, + ButtonVariant::Success => cx.theme().success_active, + ButtonVariant::Info => cx.theme().info_active, ButtonVariant::Link => cx.theme().transparent, ButtonVariant::Text => cx.theme().transparent, - ButtonVariant::Custom(colors) => { - if outline { - colors.color - } else { - colors.active - } - } + ButtonVariant::Custom(colors) => colors.active, }; let border = self.border_color(bg, outline, cx); let fg = match self { ButtonVariant::Link => cx.theme().link_active, ButtonVariant::Text => cx.theme().foreground.opacity(0.7), - _ => self.text_color(outline, cx), + _ => self.text_color(false, cx), }; let underline = self.underline(cx); let shadow = self.shadow(outline, cx); diff --git a/themes/adventure.json b/themes/adventure.json index 4d0c45f3..125b6dca 100644 --- a/themes/adventure.json +++ b/themes/adventure.json @@ -14,7 +14,7 @@ "accordion.background": "#040404", "accordion.hover.background": "#4b6479", "background": "#040404", - "border": "#333333", + "border": "#282828", "card.background": "#003a5b", "card.foreground": "#feffff", "danger.background": "#d84a33", @@ -52,7 +52,6 @@ "table.head.foreground": "#feffffb3", "table.row.border": "#4b647970", "title_bar.background": "#040404", - "title_bar.border": "#333333", "base.red": "#d84a33", "base.red.light": "#d76b42", "base.green": "#5da602", diff --git a/themes/fahrenheit.json b/themes/fahrenheit.json index 85b6019b..0b5eddb7 100644 --- a/themes/fahrenheit.json +++ b/themes/fahrenheit.json @@ -9,19 +9,19 @@ "mode": "dark", "colors": { "accent.background": "#171717", - "accent.foreground": "#dcdcdc", + "accent.foreground": "#FFFFCE", "accordion.active.background": "#1e1e1e", "accordion.background": "#2e2e2e", "accordion.hover.background": "#3e3e3e", "background": "#000000", - "border": "#444444", + "border": "#252525", "card.background": "#090909", - "card.foreground": "#dcdcdc", + "card.foreground": "#FFFFCE", "danger.background": "#593002", "danger.active.background": "#4b2901", "danger.hover.background": "#593002AA", "foreground": "#FFFFCE", - "input.border": "#3e3e3e", + "input.border": "#252525", "list.active.background": "#21010122", "list.active.border": "#720202", "list.hover.background": "#111111", @@ -29,7 +29,7 @@ "muted.foreground": "#828282", "panel.background": "#1e1e1e", "popover.background": "#090909", - "popover.foreground": "#dcdcdc", + "popover.foreground": "#FFFFCE", "primary.active.background": "#570101", "primary.background": "#720202", "primary.foreground": "#FFFFCE", @@ -43,16 +43,16 @@ "tab.foreground": "#808080", "table.background": "#1e1e1e00", "table.hover.background": "#1E1E1E", - "base.red": "#720202", - "base.red.light": "#c93636", + "base.red": "#723202", + "base.red.light": "#c97636", "base.green": "#047202", "base.green.light": "#39c936", "base.yellow": "#726302", "base.yellow.light": "#c9b536", "base.blue": "#022d72", "base.blue.light": "#0551cb", - "base.magenta": "#5d0272", - "base.magenta.light": "#ae36c9", + "base.magenta": "#3a1d75", + "base.magenta.light": "#6c36c9", "base.cyan": "#027272", "base.cyan.light": "#36c9c9" },