Help to auto-color based on tag

answered

#1

Hi All,

I am trying to edit the CSS code to help me with more visual codes. What I’d like to do is to have the entire bullet automatically color-coded when a specific tag is added.

I’m really a visual-sort of person and generally prefer bright color-coding to help me remember and recall things :slight_smile:

So far, what I’ve got has only helped me auto-color just the tag with the color I want, rather than the entire item that’s tagged. This uses this code:

[title~="#analogy"] {
background: #ffff00 !important;
color: black !important;
}

Here’s a screenshot of the thing:

43%20pm

It’ll be great if someone can help me figure out how to do this in the CSS (rather than through stylish, because it’s not super portable onto other platforms and I use a lot of them)

Thanks!


#2

Unfortunately I don’t think it’s possible to style the parent based on the its children’s properties. It’s a limitation of CSS.

Would the yellow color label work for your case? Or you just don’t want to manually apply the color label?


#3

Yes, I don’t want to manually apply the color label and it would expand the options for color coding nicely.

It’s been done in workflowy here (https://userstyles.org/styles/146297/140-background-colors-for-workflowy-lists), which requires stylish, but I presume that’s because workflowy doesn’t allow css generally? not sure

is there any way to do something like that with the CSS for dynalist?


#4

I looked at the CSS in the link. The author made a pseudo-element to bypass this problem.

You can give it a try, just replace .contentTag with .node-tag and see if it works for you.