Setting background color of item text based on tag

OK, this should be a simple one but I am failing miserably:

Why does this work

run[tag=data-HL] {
background-color: darken(yellow, 1%);
}

where as that one does not?

item[data-HL] {
background-color: darken(yellow, 1%);
}

I am just trying to have a yellow highlight (background-color) over all tasks tagged as @HL (along the lines of “styled tags” for FoldingText).

Thank you.

The issue is that item elements don’t support background colors right now, only run elements to. The good news is you can still accomplish your goal like this I think:

item[data-HL] {
  > run {
    background-color: darken(yellow, 1%);
  }
}
2 Likes

Duh! Thanks a lot for the speedy reply. This worked!

1 Like