Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom icons for Properties #274

Open
Ulhar opened this issue Oct 20, 2023 · 2 comments
Open

Custom icons for Properties #274

Ulhar opened this issue Oct 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Ulhar
Copy link

Ulhar commented Oct 20, 2023

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)

@ngsilverman
Copy link

I just opened a PR (#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

@Ulhar
Copy link
Author

Ulhar commented Jan 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants