Files
oak-gpui/crates/theme2/src/default_theme.rs
T
18431051d9 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>
2023-10-31 22:23:00 -04:00

59 lines
1.7 KiB
Rust

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()
}
}