Meta Post - Common CSS Hacks

I have some problems coloring hastags on hover. In preview mode, it already works, but in editor mode, the # has a different class (.cm-s-obsidian span.cm-hashtag-begin) than the tag itself. The following works for hovering over the the tag name, but the # will not be colored on hover in editor mode:

.tag:hover,
.cm-s-obsidian span.cm-hashtag:hover
{
  color: var(--text-hashtag-hover);
}

How can color the whole tag including # when hovering over either the tag name or #?

1 Like