diff --git a/crates/story/src/button_story.rs b/crates/story/src/button_story.rs index 018e9ec6..9df8fc9e 100644 --- a/crates/story/src/button_story.rs +++ b/crates/story/src/button_story.rs @@ -194,11 +194,31 @@ impl Render for ButtonStory { Button::new("button-6-custom", cx) .custom( ButtonCustomStyle::new(cx) - .color(cx.theme().muted) - .foreground(cx.theme().destructive) - .border(cx.theme().scrollbar) - .hover(cx.theme().tab_active_foreground) - .active(cx.theme().selection), + .color(if cx.theme().mode.is_dark() { + ui::green_900() + } else { + ui::green_500() + }) + .foreground(if cx.theme().mode.is_dark() { + ui::white() + } else { + ui::black() + }) + .border(if cx.theme().mode.is_dark() { + ui::green_800() + } else { + ui::green_600() + }) + .hover(if cx.theme().mode.is_dark() { + ui::green_800() + } else { + ui::green_500() + }) + .active(if cx.theme().mode.is_dark() { + ui::green_950() + } else { + ui::green_600() + }), ) .label("Custom Button") .disabled(disabled) diff --git a/crates/ui/src/button.rs b/crates/ui/src/button.rs index 3603e9cb..1da7b6d9 100644 --- a/crates/ui/src/button.rs +++ b/crates/ui/src/button.rs @@ -594,6 +594,7 @@ impl ButtonStyle { ButtonStyle::Link | ButtonStyle::Ghost | ButtonStyle::Text => cx.theme().transparent, ButtonStyle::Primary => cx.theme().primary.opacity(0.15), ButtonStyle::Danger => cx.theme().destructive.opacity(0.15), + ButtonStyle::Custom(style) => style.color.opacity(0.15), _ => cx.theme().secondary.darken(0.2).grayscale(), }; let fg = match self {