diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e75453..a483cbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - You can now check for plugin updates in the Todoist plugin settings. - The JSON query is now validated and errors are presented in a more user-friendly fashion: ![Query parsing error example](./assets/query-parsing-error-example.png) +- Any `workspace-leaf` which has an injected query will have the `contains-todoist-query` CSS class attached. This allows you to style these leafs independently of the others. ### 🔃 Changed diff --git a/README.md b/README.md index 4806990..f0aa746 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,9 @@ _Tested with Obsidian 0.8.14 and Volcano 1.2.1, your results may vary!_ ### General -There are a few CSS classes in the generated DOM, which you can use to customize the rendering of the list: +Any `workspace-leaf` which has an injected Todoist query will have the `contains-todoist-query` class attached to it. + +There are also few CSS classes in the generated DOM, which you can use to customize the rendering of the list: - `.todoist-query-title`: Attached to the header that contains the query title. - `.todoist-refresh-button`: Attached to the refresh button. diff --git a/src/plugin.ts b/src/plugin.ts index f4aa7b7..b3ad3d7 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -194,9 +194,12 @@ export default class TodoistPlugin { }); } + const workspaceLeaf = root.closest(".workspace-leaf"); + workspaceLeaf.classList.add("contains-todoist-query"); + const injection = { component: queryNode, - workspaceLeaf: root.closest(".workspace-leaf"), + workspaceLeaf: workspaceLeaf, }; debug({