theme: build out the theme engine core with resolve pipeline

This commit is contained in:
2026-10-28 10:54:02 +07:00
parent b4d3359d4f
commit 12d4120bfd
14 changed files with 1434 additions and 37 deletions
+23
View File
@@ -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,
}
}