From 851ac6cdd3c5a865d43968ea81d98b5b7c859728 Mon Sep 17 00:00:00 2001 From: Erasin Wang Date: Sun, 26 Mar 2023 00:41:31 +0800 Subject: [PATCH] Add theme keys for (un)checked markup list items (#6434) --- book/src/themes.md | 2 ++ runtime/queries/markdown/highlights.scm | 3 +++ runtime/themes/onelight.toml | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/book/src/themes.md b/book/src/themes.md index 994542c5a..7accb67f0 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -228,6 +228,8 @@ We use a similar set of scopes as - `list` - `unnumbered` - `numbered` + - `checked` + - `unchecked` - `bold` - `italic` - `strikethrough` diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm index 80c9f9583..72bb68dc2 100644 --- a/runtime/queries/markdown/highlights.scm +++ b/runtime/queries/markdown/highlights.scm @@ -39,6 +39,9 @@ (list_marker_parenthesis) ] @markup.list.numbered +(task_list_marker_checked) @markup.list.checked +(task_list_marker_unchecked) @markup.list.unchecked + (thematic_break) @punctuation.special [ diff --git a/runtime/themes/onelight.toml b/runtime/themes/onelight.toml index a9d7a0d32..e35abdb37 100644 --- a/runtime/themes/onelight.toml +++ b/runtime/themes/onelight.toml @@ -80,9 +80,11 @@ "markup.list" = { fg = "light-blue" } "markup.list.unnumbered" = { fg = "light-blue" } "markup.list.numbered" = { fg = "light-blue" } +"markup.list.checked" = { fg = "green" } +"markup.list.unchecked" = { fg = "blue" } "markup.bold" = { fg = "yellow", modifiers = ["bold"] } "markup.italic" = { fg = "purple", modifiers = ["italic"] } -"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.strikethrough" = { fg = "red", modifiers = ["crossed_out"] } "markup.link" = { fg = "light-blue" } "markup.link.url" = { fg = "cyan", modifiers = ["underlined"] } "markup.link.text" = { fg = "light-blue" }