theme: build out the theme engine core with resolve pipeline
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//! Built-in `ThemeDefinition` presets (D11).
|
||||
|
||||
use crate::definition::ThemeDefinition;
|
||||
|
||||
const TOKYO_NIGHT: &str = include_str!("../presets/tokyo-night.toml");
|
||||
|
||||
pub fn preset_names() -> &'static [&'static str] {
|
||||
&["tokyo-night"]
|
||||
}
|
||||
|
||||
/// Parses the named preset.
|
||||
pub fn builtin(name: &str) -> Option<ThemeDefinition> {
|
||||
match name {
|
||||
"tokyo-night" => match ThemeDefinition::parse_toml(TOKYO_NIGHT) {
|
||||
Ok(def) => Some(def),
|
||||
Err(err) => {
|
||||
eprintln!("bundled preset tokyo-night failed to parse: {err}");
|
||||
None
|
||||
}
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user