-
-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
themes
directory (#1577)
* feat: add serde struct for theme file * feat: update client to load the theme palette * feat: merge themes in the setup phase * chore: delete debug message in test * feat: add theme_dir options * fix: boxing large enum variant
- Loading branch information
Showing
9 changed files
with
150 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Dracula Theme | ||
|
||
themes: | ||
dracula: | ||
# From https://github.com/dracula/zellij | ||
bg: [40, 42, 54] | ||
red: [255, 85, 85] | ||
green: [80, 250, 123] | ||
yellow: [241, 250, 140] | ||
blue: [98, 114, 164] | ||
magenta: [255, 121, 198] | ||
orange: [255, 184, 108] | ||
fg: [248, 248, 242] | ||
cyan: [139, 233, 253] | ||
black: [0, 0, 0] | ||
white: [255, 255, 255] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Nord theme | ||
|
||
themes: | ||
nord: | ||
fg: [216, 222, 233] #D8DEE9 | ||
bg: [46, 52, 64] #2E3440 | ||
black: [59, 66, 82] #3B4252 | ||
red: [191, 97, 106] #BF616A | ||
green: [163, 190, 140] #A3BE8C | ||
yellow: [235,203,139] #EBCB8B | ||
blue: [129, 161, 193] #81A1C1 | ||
magenta: [180, 142, 173] #B48EAD | ||
cyan: [136, 192, 208] #88C0D0 | ||
white: [229, 233, 240] #E5E9F0 | ||
orange: [208, 135, 112] #D08770 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use super::super::theme::*; | ||
use std::path::PathBuf; | ||
|
||
fn theme_test_dir(theme: String) -> PathBuf { | ||
let root = Path::new(env!("CARGO_MANIFEST_DIR")); | ||
let theme_dir = root.join("src/input/unit/fixtures/themes"); | ||
theme_dir.join(theme) | ||
} | ||
|
||
#[test] | ||
fn dracula_theme_is_ok() { | ||
let path = theme_test_dir("dracula.yaml".into()); | ||
let theme = ThemesFromYaml::from_path(&path); | ||
assert!(theme.is_ok()); | ||
} | ||
|
||
#[test] | ||
fn no_theme_is_err() { | ||
let path = theme_test_dir("nonexistent.yaml".into()); | ||
let theme = ThemesFromYaml::from_path(&path); | ||
assert!(theme.is_err()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters