obsidian-iconize icon indicating copy to clipboard operation
obsidian-iconize copied to clipboard

Custom icons for Properties

Open Ulhar opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Obsidian by default doesn't offer much customization for Properties outside of name, and the icons are determined solely by data type

Describe the solution you'd like Ideally, in Properties view, right-clicking a custom Property would let you choose a custom icon to accompany it, and that icon will replace the default icon based on its type (e.g. if you have a List property, instead of the List icon, you could change it to a different one)

Describe alternatives you've considered I have tried using a CSS snippet to override the icons, but this only works in the Properties editor that shows at the top of a note, not in the sidebar (CSS selectors can't filter by element content, and that's the only way the property names are exposed)

Additional context Results of aforementioned CSS snippet: Properties view on a note, with a 'characters' property showing a multi-user icon instead of the normal list icon (it's a rather messy snippet, using SVG inlining to replace the icon, and I don't think it would hold up at scale; I mostly offer this as an example use case)

Ulhar avatar Oct 20 '23 03:10 Ulhar

I just opened a PR (https://github.com/FlorianWoelki/obsidian-iconize/pull/353) which makes it possible to associate file properties with specific icons using custom rules. So the solution is a little different from what you proposed, rather than right-clicking a property, you would go to the Iconize plugin settings and add a custom rule.

For example, if you wanted a particular icon for all files that have a characters property you would simply write:

this.characters

ngsilverman avatar Jan 17 '24 16:01 ngsilverman

Oh, I was actually thinking about properties themselves having custom icons, similar to how the tags property has a dedicated icon :sweat_smile: Sorry about any confusion there

Ulhar avatar Jan 24 '24 23:01 Ulhar