Add CSS classes to properties to enable targeted custom styling (e.g. of tags)

I want to be able to style properties in the same way that I can style text elements within a note. My specific use case are tags which lose all visual differentiation when used as property.

Suggestion:

  • Add CSS classes for each type of property (text, numeric, date, time, list, tags)
  • Add either a CSS class or alternatively a data attribute for targeting elements of a specific property (analog to the markup for tags within a note)
  • Ideally match the markup for tags in properties and inline tags so that both can be styled using a single selector
4 Likes

Very much +1 on this - I’ve been trying to set colours with CSS for specific tags everywhere the tag is present for ages. This plugin GitHub - code-of-chaos/obsidian-colored_tags_wrangler: Obsidian Plugin : Assign colors to tags. Has integrations with other plugins, like Kanban. does a lot of it, but it runs a piece of code to insert info about tags in the properties in order to target for styling, and it’s quite unreliable - especially with other plugins running that touch the properties (Linter, etc). There’s an open issue about this, but again I’ve found the workaround to

In short, adding classes for the tag in the same way that it’s done in the body of the note would be ideal and would remove all of the issues and workarounds that are currently required.

2 Likes