Assign more colors.

This commit is contained in:
Tom Alexander 2025-02-22 16:46:47 -05:00
parent 57eb1b81ec
commit 3245e830d2
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 18 additions and 3 deletions

View File

@ -1,12 +1,16 @@
:root {
--srclg-nix-srchl-keyword-color: #1a936f;
--srclg-nix-srchl-comment-color: #048a81;
--srclg-nix-srchl-property-color: #bfbccb;
--srclg-nix-srchl-string-color: #ecc30b;
}
@media (prefers-color-scheme: light) {
:root {
--srclg-nix-srchl-keyword-color: green;
--srclg-nix-srchl-comment-color: #bfbccb;
--srclg-nix-srchl-keyword-color: #e56c90;
--srclg-nix-srchl-comment-color: #fb757e;
--srclg-nix-srchl-property-color: #404334;
--srclg-nix-srchl-string-color: #133cf4;
}
}
@ -19,6 +23,12 @@
.srchl_comment {
color: var(--srclg-nix-srchl-comment-color);
}
.srchl_property {
color: var(--srclg-nix-srchl-property-color);
}
.srchl_string {
color: var(--srclg-nix-srchl-string-color);
}
}
}
}

View File

@ -137,7 +137,12 @@ fn highlight_nix<L>(lines: &[L]) -> Result<Vec<ISrcLine>, CustomError>
where
L: Borrow<str>,
{
let highlight_names = ["comment", "keyword"];
let highlight_names = [
"comment", "keyword", "property",
"string",
// "string.special.path",
// "string.special.uri",
];
// Need 1 highlighter per thread
let mut highlighter = Highlighter::new();
let language = tree_sitter_nix::LANGUAGE.into();