I searched for plugins, found one that does syntax highlighting of code blocks, but seemingly not for the frontmatter.
What I’m trying to do
I’d like to have the frontmatter information neater and more readable.
I saw in some YT videos (i.e. from Nicole van der Hoeven) that in her notes the frontmatter field-names are in different colors than the field-values.
How can I achieve that?
Would I have to create a specific CSS-snippet for that?
If so, what would be the syntax?
Here’s the CSS to change the color of the various YAML elements:
/* color YAML value text */
span.cm-meta.cm-hmd-frontmatter + span.cm-hmd-frontmatter {
color: blue;
}
/* color YAML value - if it's a number */
span.cm-number.cm-hmd-frontmatter {
color: pink !important;
}
/* color YAML key text */
span.cm-atom.cm-hmd-frontmatter {
color: green;
}
/* color YAML separator text */
span.cm-meta.cm-hmd-frontmatter {
color: red;
}