Rework theme2
with new theme structure (#3194)
This PR reworks the theme definition in the `theme2` crate to be based off of the new theme work that @iamnbutler has been working on. We're still developing the new theme system, but it is complete enough that we can now load the default theme and use it to theme the storybook (albeit with some further refining of the color palette required). --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com> Co-authored-by: Marshall Bowers <marshall@zed.dev>
This commit is contained in:
parent
ed5f1d3bdd
commit
18431051d9
51 changed files with 1615 additions and 494 deletions
|
@ -21,29 +21,23 @@ pub enum ButtonVariant {
|
|||
|
||||
impl ButtonVariant {
|
||||
pub fn bg_color(&self, cx: &mut WindowContext) -> Hsla {
|
||||
let theme = theme(cx);
|
||||
|
||||
match self {
|
||||
ButtonVariant::Ghost => theme.ghost_element,
|
||||
ButtonVariant::Filled => theme.filled_element,
|
||||
ButtonVariant::Ghost => cx.theme().colors().ghost_element,
|
||||
ButtonVariant::Filled => cx.theme().colors().element,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bg_color_hover(&self, cx: &mut WindowContext) -> Hsla {
|
||||
let theme = theme(cx);
|
||||
|
||||
match self {
|
||||
ButtonVariant::Ghost => theme.ghost_element_hover,
|
||||
ButtonVariant::Filled => theme.filled_element_hover,
|
||||
ButtonVariant::Ghost => cx.theme().colors().ghost_element_hover,
|
||||
ButtonVariant::Filled => cx.theme().colors().element_hover,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bg_color_active(&self, cx: &mut WindowContext) -> Hsla {
|
||||
let theme = theme(cx);
|
||||
|
||||
match self {
|
||||
ButtonVariant::Ghost => theme.ghost_element_active,
|
||||
ButtonVariant::Filled => theme.filled_element_active,
|
||||
ButtonVariant::Ghost => cx.theme().colors().ghost_element_active,
|
||||
ButtonVariant::Filled => cx.theme().colors().element_active,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue