I create notes for individual projects to manage todos. If there is a todo that I’m waiting on someone else for, I tag it with #WF.
I then have a master note that uses dataviewjs to sort all actions into project based lists of actions. It would be great to be able to change the color of the tasks tagged with #WF just to quickly flag for me that these are actions I’m waiting on someone else for. CSS style snippet will style the original task but it doesn’t style it within the dataviewjs query.
Note I’m trying to use dataviewjs, not dataview.
Thanks for any help!
Things I have tried
Searched a ton of forum threads and no one seems to have been interested in this before. Also spent a lot of time with Chat GPT but it couldn’t figure it out either.
Thank you so much for your help! When I try to use a dv.container though I still get an error. This is my datajsview script: As an experiment I’m trying to change tasks tagged with high priority emoji to red font
Evaluation Error: TypeError: dv.container is not a function
at eval (eval at (plugin:dataview), :27:16)
at Proxy.forEach (plugin:dataview:8233:13)
at eval (eval at (plugin:dataview), :24:16)
at DataviewInlineApi.eval (plugin:dataview:18404:16)
at evalInContext (plugin:dataview:18405:7)
at asyncEvalInContext (plugin:dataview:18415:32)
at DataviewJSRenderer.render (plugin:dataview:18436:19)
at DataviewRefreshableRenderer.maybeRefresh (plugin:dataview:18014:22)
at e.tryTrigger (app://obsidian.md/app.js:1:695499)
at e.trigger (app://obsidian.md/app.js:1:695432)
which I itnerpret to mean I dv.container isn’t supported
dv.container is an object where you can set some stuff, and in particular the classname associated with the output of this query. In the thread below, you can see one example of such usage (near the third line) where onechan adds the TaskTable class to the list, if it’s not there from before.
Then one could use CSS to target this particular query since we now know a class related to it.
Regarding the handling of high priority items, you would then rather change the visual element of a given task, and include some extra information, e.g. adding yet another class using <span> element or similar.
A similar example extending formatting for some of the elements using visual, see the thread below, where I first learned about this kind of trickery.