Things I have tried
In Dataviewjs, exposing the tags field so that tags are visible in the table in reading mode:
let year = DateTime.now().year
let month = DateTime.now().toFormat("MM")
let day = DateTime.now().toFormat("dd")
let today = year + "-" + month + "-" + day
console.log(today)
dv.table(
["Hour", "Work/Play", "Activity", "Tags"],
dv.pages('"SPACE-TIME/Chronicle"')
//.forEach(p => console.log("Date: " + p.date.toFormat("yyyy-MM-dd")))
.where(p => p.date?.toFormat("yyyy-MM-dd") == today)
.sort(p => p.file.name, 'asc')
.map(p => [p.file.link, p.workplay, p.worktype || p.playtype, p.tags])
)
CSS snippet, trying to target the Auto Class-generated class .work-task
along with the Dataview table class and row :
.work-task.table-view-table > tbody > tr {
background-color: rgb(45, 50, 40) !important;
}
What I’m trying to do
I’m trying to find a way to highlight Dataview table rows based on tags that are in the notes included in the Dataviewjs query.
In Auto Class settings I’ve set up a .work-task
class based on the tag #work-task. The class does appear to be functional; it turns the background of the note I’ve put the tag into the color I’ve specified, provided of course I remove the .table-view-table
selector in the above snippet. But when I try both .work-task.table-view-table
selectors to try to target the Dataview table row for that note, no dice.
Any ideas? I’m not at all married to Auto Class; if you know of another way I can accomplish what I’m trying to do, ie. highlight the Dataview table row based on data in the note, I’m all ears.