darrenkuro / obsidian-basetag

A lightweight obsidian plugin to render the basename of tags in preview mode.
MIT License
27 stars 1 forks source link

[BUG] Adding emoticons for tags in Properties does not work #7

Closed dbarenholz closed 11 months ago

dbarenholz commented 11 months ago

Problem:

Your README states how to add emoticons to tags to make them look pretty. One of the ways I use this, is for "instrument" tags, to add the emoticon of the instrument in front.

a.basename-tag[href*="repertoire/piano"]::before {
    content: "🎹 ";
}

I have markdown files with frontmatter tags for these instruments.

---
tags: "#repertoire/piano"
---

Note content here. This is a piece for #repertoire/piano.

Expected behaviour:

The emoticon shows up in the Properties view, as it does in normal text.

Actual behaviour:

The emoticon does not show up in Properties view; see screenshot. image

dbarenholz commented 11 months ago

It seems the basename-tag class does not get added to tags in Properties, which is causing the styling to (obviously) not work there.

Note: I just checked in default theme: same issue.

darrenkuro commented 11 months ago

The issue is that properties are structured entirely differently and I haven't been actively using Obsidian so how the properties are handled by this plug-in are like band-aids. I don't have much time so just slapped on another band-aid for now. For every css you'll need another selector for the property, for instance:

a.basename-tag[href*="repertoire/piano"]::before,
span.basename-tag[data-tag*="repertoire/piano"]::before {
    content: "🎹 ";
}