insanum / obsidian_nord

A nord theme for Obsidian
MIT License
243 stars 63 forks source link

[Improvement] Same tag highlight in edit and reading view #35

Closed vii33 closed 2 years ago

vii33 commented 2 years ago

Hi, I love your theme. Thanks a lot for creating it! 🤩

I have one question, though: Is there a reason why tags aren't visualized the same in the edit and reading view?

Example: grafik Left: Edit view, Right: Reading view

I really like the "taggish" styling in the reading view so I updated the CSS in the edit view -> Same look: grafik


Code:

/* ----------------------------------------------------------------------------------- */
/* STYLING OF TAGS */

span.cm-hashtag {
  color: var(--text-tag) !important;
  background-color: var(--background-secondary-alt);
  text-decoration: none !important;
  padding: 2px 0px 2px 0px;
}

span.cm-formatting-hashtag {
  padding: 3px 0px 2px 4px;
  border-radius: 4px 0px 0px 4px;  /* left radiuses */
}

span.cm-hashtag-end {
    padding: 2px 4px 2px 0px;
    border-radius: 0px 4px 4px 0px; /* right radiuses */
}

/* ----------------------------------------------------------------------------------- */
/*  Special styling for certain tag words (optional). Suffix the tag name, e.g. "todo" */

span.cm-tag-todo {
  color: #080808 !important;
  background: #d6ae5e; 
}

Remarks for others interested:

Offset bug: grafik

insanum commented 2 years ago

This was a good idea and I've implemented it. :-)