Questions about custom tag styling using CSS

For item two (tags in the editor), these two posts helped me understanding them when I was starting out:


Here’s an example of a custom tag (from a while ago):

I don’t see it posted on the forum (was in Discord), but here’s one take via FireIsGood for styling tags universally and giving colors to specific ones:

/*------- Tag formatting -------*/
.markdown-source-view .cm-hashtag {
  background: var(--color-base-10);
  color: var(--tag-color);
  border-top: 2px solid;
  border-bottom: 2px solid;
  line-height: 2em;
  font-weight: 500;
}
.markdown-source-view .cm-hashtag-begin {
  border-left: 2px solid;
  padding-top: 1px;
  padding-right: 1px;
  padding-bottom: 3.5px;
}
.markdown-source-view .cm-hashtag-end {
  border-right: 2px solid;
  padding-top: 1px;
  padding-bottom: 3.5px;
}
.markdown-preview-view .tag {
  background: var(--color-base-10);
  color: var(--tag-color);
  border: 2px solid;
  line-height: 2em;
  font-weight: 500;
}

/*------- Tag colors -------*/
.cm-tag-Google, [href="#Google"] {--tag-color: var(--color-blue)}
.cm-tag-test-tag, [href="#test-tag"] {--tag-color: var(--color-red)}
.cm-tag-another-tag, [href="#another-tag"] {--tag-color: var(--color-green)}

Lots of options depending on what you’d like to exactly do.