theme: Rename destructive to danger (#541)
This commit is contained in:
parent
31736b0e21
commit
464fceac96
4 changed files with 31 additions and 31 deletions
|
|
@ -253,7 +253,7 @@ impl Render for TextStory {
|
|||
.child(Tag::primary().small().child("Tag"))
|
||||
.child(Tag::secondary().small().child("Secondary"))
|
||||
.child(Tag::outline().small().child("Outline"))
|
||||
.child(Tag::destructive().small().child("Destructive"))
|
||||
.child(Tag::danger().small().child("danger"))
|
||||
.child(Tag::custom(ui::yellow_500(), ui::yellow_800(), ui::yellow_500()).small().child("Custom"))
|
||||
)
|
||||
.child(
|
||||
|
|
@ -261,7 +261,7 @@ impl Render for TextStory {
|
|||
.child(Tag::primary().child("Tag"))
|
||||
.child(Tag::secondary().child("Secondary"))
|
||||
.child(Tag::outline().child("Outline"))
|
||||
.child(Tag::destructive().child("Destructive"))
|
||||
.child(Tag::danger().child("danger"))
|
||||
.child(Tag::custom(ui::yellow_500(), ui::yellow_800(), ui::yellow_500()).child("Custom"))
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ impl ButtonVariant {
|
|||
match self {
|
||||
ButtonVariant::Primary => cx.theme().primary,
|
||||
ButtonVariant::Secondary => cx.theme().secondary,
|
||||
ButtonVariant::Danger => cx.theme().destructive,
|
||||
ButtonVariant::Danger => cx.theme().danger,
|
||||
ButtonVariant::Outline
|
||||
| ButtonVariant::Ghost
|
||||
| ButtonVariant::Link
|
||||
|
|
@ -488,7 +488,7 @@ impl ButtonVariant {
|
|||
ButtonVariant::Secondary | ButtonVariant::Outline | ButtonVariant::Ghost => {
|
||||
cx.theme().secondary_foreground
|
||||
}
|
||||
ButtonVariant::Danger => cx.theme().destructive_foreground,
|
||||
ButtonVariant::Danger => cx.theme().danger_foreground,
|
||||
ButtonVariant::Link => cx.theme().link,
|
||||
ButtonVariant::Text => cx.theme().foreground,
|
||||
ButtonVariant::Custom(colors) => colors.foreground,
|
||||
|
|
@ -499,7 +499,7 @@ impl ButtonVariant {
|
|||
match self {
|
||||
ButtonVariant::Primary => cx.theme().primary,
|
||||
ButtonVariant::Secondary => cx.theme().border,
|
||||
ButtonVariant::Danger => cx.theme().destructive,
|
||||
ButtonVariant::Danger => cx.theme().danger,
|
||||
ButtonVariant::Outline => cx.theme().border,
|
||||
ButtonVariant::Ghost | ButtonVariant::Link | ButtonVariant::Text => {
|
||||
cx.theme().transparent
|
||||
|
|
@ -543,7 +543,7 @@ impl ButtonVariant {
|
|||
let bg = match self {
|
||||
ButtonVariant::Primary => cx.theme().primary_hover,
|
||||
ButtonVariant::Secondary | ButtonVariant::Outline => cx.theme().secondary_hover,
|
||||
ButtonVariant::Danger => cx.theme().destructive_hover,
|
||||
ButtonVariant::Danger => cx.theme().danger_hover,
|
||||
ButtonVariant::Ghost => {
|
||||
if cx.theme().mode.is_dark() {
|
||||
cx.theme().secondary.lighten(0.1).opacity(0.8)
|
||||
|
|
@ -583,7 +583,7 @@ impl ButtonVariant {
|
|||
cx.theme().secondary.darken(0.2).opacity(0.8)
|
||||
}
|
||||
}
|
||||
ButtonVariant::Danger => cx.theme().destructive_active,
|
||||
ButtonVariant::Danger => cx.theme().danger_active,
|
||||
ButtonVariant::Link => cx.theme().transparent,
|
||||
ButtonVariant::Text => cx.theme().transparent,
|
||||
ButtonVariant::Custom(colors) => colors.active,
|
||||
|
|
@ -617,7 +617,7 @@ impl ButtonVariant {
|
|||
cx.theme().secondary.darken(0.2).opacity(0.8)
|
||||
}
|
||||
}
|
||||
ButtonVariant::Danger => cx.theme().destructive_active,
|
||||
ButtonVariant::Danger => cx.theme().danger_active,
|
||||
ButtonVariant::Link => cx.theme().transparent,
|
||||
ButtonVariant::Text => cx.theme().transparent,
|
||||
ButtonVariant::Custom(colors) => colors.active,
|
||||
|
|
@ -647,7 +647,7 @@ impl ButtonVariant {
|
|||
| ButtonVariant::Outline
|
||||
| ButtonVariant::Text => cx.theme().transparent,
|
||||
ButtonVariant::Primary => cx.theme().primary.opacity(0.15),
|
||||
ButtonVariant::Danger => cx.theme().destructive.opacity(0.15),
|
||||
ButtonVariant::Danger => cx.theme().danger.opacity(0.15),
|
||||
ButtonVariant::Secondary => cx.theme().secondary.opacity(1.5),
|
||||
ButtonVariant::Custom(style) => style.color.opacity(0.15),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ pub enum TagVariant {
|
|||
Primary,
|
||||
Secondary,
|
||||
Outline,
|
||||
Destructive,
|
||||
Danger,
|
||||
Custom {
|
||||
color: Hsla,
|
||||
foreground: Hsla,
|
||||
|
|
@ -23,7 +23,7 @@ impl TagVariant {
|
|||
Self::Primary => cx.theme().primary,
|
||||
Self::Secondary => cx.theme().secondary,
|
||||
Self::Outline => transparent_black(),
|
||||
Self::Destructive => cx.theme().destructive,
|
||||
Self::Danger => cx.theme().danger,
|
||||
Self::Custom { color, .. } => *color,
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ impl TagVariant {
|
|||
Self::Primary => cx.theme().primary,
|
||||
Self::Secondary => cx.theme().secondary,
|
||||
Self::Outline => cx.theme().border,
|
||||
Self::Destructive => cx.theme().destructive,
|
||||
Self::Danger => cx.theme().danger,
|
||||
Self::Custom { border, .. } => *border,
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ impl TagVariant {
|
|||
Self::Primary => cx.theme().primary_foreground,
|
||||
Self::Secondary => cx.theme().secondary_foreground,
|
||||
Self::Outline => cx.theme().foreground,
|
||||
Self::Destructive => cx.theme().destructive_foreground,
|
||||
Self::Danger => cx.theme().danger_foreground,
|
||||
Self::Custom { foreground, .. } => *foreground,
|
||||
}
|
||||
}
|
||||
|
|
@ -84,8 +84,8 @@ impl Tag {
|
|||
Self::new().with_variant(TagVariant::Outline)
|
||||
}
|
||||
|
||||
pub fn destructive() -> Self {
|
||||
Self::new().with_variant(TagVariant::Destructive)
|
||||
pub fn danger() -> Self {
|
||||
Self::new().with_variant(TagVariant::Danger)
|
||||
}
|
||||
|
||||
pub fn custom(color: Hsla, foreground: Hsla, border: Hsla) -> Self {
|
||||
|
|
|
|||
|
|
@ -158,10 +158,10 @@ pub struct ThemeColor {
|
|||
pub window_border: Hsla,
|
||||
pub card: Hsla,
|
||||
pub card_foreground: Hsla,
|
||||
pub destructive: Hsla,
|
||||
pub destructive_active: Hsla,
|
||||
pub destructive_foreground: Hsla,
|
||||
pub destructive_hover: Hsla,
|
||||
pub danger: Hsla,
|
||||
pub danger_active: Hsla,
|
||||
pub danger_foreground: Hsla,
|
||||
pub danger_hover: Hsla,
|
||||
pub drag_border: Hsla,
|
||||
pub drop_target: Hsla,
|
||||
pub foreground: Hsla,
|
||||
|
|
@ -234,10 +234,10 @@ impl ThemeColor {
|
|||
window_border: hsl(240.0, 5.9, 78.0),
|
||||
card: hsl(0.0, 0.0, 100.0),
|
||||
card_foreground: hsl(240.0, 10.0, 3.9),
|
||||
destructive: hsl(0.0, 84.2, 60.2),
|
||||
destructive_active: hsl(0.0, 84.2, 47.0),
|
||||
destructive_foreground: hsl(0.0, 0.0, 98.0),
|
||||
destructive_hover: hsl(0.0, 84.2, 65.0),
|
||||
danger: hsl(0.0, 84.2, 60.2),
|
||||
danger_active: hsl(0.0, 84.2, 47.0),
|
||||
danger_foreground: hsl(0.0, 0.0, 98.0),
|
||||
danger_hover: hsl(0.0, 84.2, 65.0),
|
||||
drag_border: crate::blue_500(),
|
||||
drop_target: hsl(235.0, 30., 44.0).opacity(0.25),
|
||||
foreground: hsl(240.0, 10., 3.9),
|
||||
|
|
@ -310,10 +310,10 @@ impl ThemeColor {
|
|||
window_border: hsl(240.0, 3.7, 28.0),
|
||||
card: hsl(0.0, 0.0, 8.0),
|
||||
card_foreground: hsl(0.0, 0.0, 78.0),
|
||||
destructive: hsl(0.0, 62.8, 30.6),
|
||||
destructive_active: hsl(0.0, 62.8, 20.6),
|
||||
destructive_foreground: hsl(0.0, 0.0, 78.0),
|
||||
destructive_hover: hsl(0.0, 62.8, 35.6),
|
||||
danger: hsl(0.0, 62.8, 30.6),
|
||||
danger_active: hsl(0.0, 62.8, 20.6),
|
||||
danger_foreground: hsl(0.0, 0.0, 78.0),
|
||||
danger_hover: hsl(0.0, 62.8, 35.6),
|
||||
drag_border: crate::blue_500(),
|
||||
drop_target: hsl(235.0, 30., 44.0).opacity(0.1),
|
||||
foreground: hsl(0., 0., 78.),
|
||||
|
|
@ -434,10 +434,10 @@ impl Theme {
|
|||
self.secondary_hover = self.secondary_hover.apply(mask_color);
|
||||
self.secondary_active = self.secondary_active.apply(mask_color);
|
||||
self.secondary_foreground = self.secondary_foreground.apply(mask_color);
|
||||
// self.destructive = self.destructive.apply(mask_color);
|
||||
// self.destructive_hover = self.destructive_hover.apply(mask_color);
|
||||
// self.destructive_active = self.destructive_active.apply(mask_color);
|
||||
// self.destructive_foreground = self.destructive_foreground.apply(mask_color);
|
||||
// self.danger = self.danger.apply(mask_color);
|
||||
// self.danger_hover = self.danger_hover.apply(mask_color);
|
||||
// self.danger_active = self.danger_active.apply(mask_color);
|
||||
// self.danger_foreground = self.danger_foreground.apply(mask_color);
|
||||
self.muted = self.muted.apply(mask_color);
|
||||
self.muted_foreground = self.muted_foreground.apply(mask_color);
|
||||
self.accent = self.accent.apply(mask_color);
|
||||
|
|
|
|||
Loading…
Reference in a new issue