diff --git a/crates/theme/src/registry.rs b/crates/theme/src/registry.rs index 55f61f7eb2b81e6ff8ebcb0d8afd1bb9212c7f8a..5a89ce4fc5f315d2185dae3b395326ee803f5e63 100644 --- a/crates/theme/src/registry.rs +++ b/crates/theme/src/registry.rs @@ -137,6 +137,10 @@ impl ThemeRegistry { .color .as_ref() .and_then(|color| try_parse_color(color).ok()), + background_color: highlight + .background_color + .as_ref() + .and_then(|color| try_parse_color(color).ok()), font_style: highlight.font_style.map(Into::into), font_weight: highlight.font_weight.map(Into::into), ..Default::default() diff --git a/crates/theme/src/schema.rs b/crates/theme/src/schema.rs index b4b494a803e84eda77491da213d6e6b132e0a85d..e79b80ff44ef3ac5e506965c61fc025230c54175 100644 --- a/crates/theme/src/schema.rs +++ b/crates/theme/src/schema.rs @@ -117,6 +117,10 @@ impl ThemeStyleContent { .color .as_ref() .and_then(|color| try_parse_color(color).ok()), + background_color: style + .background_color + .as_ref() + .and_then(|color| try_parse_color(color).ok()), font_style: style .font_style .map(|font_style| FontStyle::from(font_style)), @@ -1304,6 +1308,9 @@ impl From for FontWeight { pub struct HighlightStyleContent { pub color: Option, + #[serde(deserialize_with = "treat_error_as_none")] + pub background_color: Option, + #[serde(deserialize_with = "treat_error_as_none")] pub font_style: Option, @@ -1313,7 +1320,10 @@ pub struct HighlightStyleContent { impl HighlightStyleContent { pub fn is_empty(&self) -> bool { - self.color.is_none() && self.font_style.is_none() && self.font_weight.is_none() + self.color.is_none() + && self.background_color.is_none() + && self.font_style.is_none() + && self.font_weight.is_none() } } diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index b323354965c9e438547421dcc5c270cd3eba809c..1213ab387f036969010bb4afc69f87891675cc5c 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -241,6 +241,7 @@ impl VsCodeThemeConverter { let highlight_style = HighlightStyleContent { color: token_color.settings.foreground.clone(), + background_color: token_color.settings.background.clone(), font_style: token_color .settings .font_style