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
58
crates/theme2/src/default_theme.rs
Normal file
58
crates/theme2/src/default_theme.rs
Normal file
|
@ -0,0 +1,58 @@
|
|||
use crate::{
|
||||
colors::{GitStatusColors, PlayerColors, StatusColors, SystemColors, ThemeColors, ThemeStyle},
|
||||
default_color_scales, Appearance, SyntaxStyles, ThemeFamily, ThemeVariant,
|
||||
};
|
||||
|
||||
fn zed_pro_daylight() -> ThemeVariant {
|
||||
ThemeVariant {
|
||||
id: "zed_pro_daylight".to_string(),
|
||||
name: "Zed Pro Daylight".to_string(),
|
||||
appearance: Appearance::Light,
|
||||
styles: ThemeStyle {
|
||||
system: SystemColors::default(),
|
||||
colors: ThemeColors::default_light(),
|
||||
status: StatusColors::default(),
|
||||
git: GitStatusColors::default(),
|
||||
player: PlayerColors::default(),
|
||||
syntax: SyntaxStyles::default_light(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn zed_pro_moonlight() -> ThemeVariant {
|
||||
ThemeVariant {
|
||||
id: "zed_pro_moonlight".to_string(),
|
||||
name: "Zed Pro Moonlight".to_string(),
|
||||
appearance: Appearance::Light,
|
||||
styles: ThemeStyle {
|
||||
system: SystemColors::default(),
|
||||
colors: ThemeColors::default_dark(),
|
||||
status: StatusColors::default(),
|
||||
git: GitStatusColors::default(),
|
||||
player: PlayerColors::default(),
|
||||
syntax: SyntaxStyles::default_dark(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn zed_pro_family() -> ThemeFamily {
|
||||
ThemeFamily {
|
||||
id: "zed_pro".to_string(),
|
||||
name: "Zed Pro".to_string(),
|
||||
author: "Zed Team".to_string(),
|
||||
themes: vec![zed_pro_daylight(), zed_pro_moonlight()],
|
||||
scales: default_color_scales(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ThemeFamily {
|
||||
fn default() -> Self {
|
||||
zed_pro_family()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ThemeVariant {
|
||||
fn default() -> Self {
|
||||
zed_pro_daylight()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue