What I’m trying to do
I want to only modify font size on codeblocks that are tagged as such, for example for lengthy logs.
For all other cases I’d like to keep the font size of code blocks as it is:
Things I have tried
Using this thread I was able to modify the font size of all code blocks using custom css:
.markdown-preview-view code {
font-size: 8px !important;
}
.cm-s-obsidian .HyperMD-codeblock {
font-size: 8px;
}
However, I’m not yet sure how to target only specific code blocks or if it makes more sense to define a new “language” like Shell-Logs
for this case?
EDIT:
I did define a new language shell-log
that is rendered smaller, but I only managed this in reading mode. In live-preview it does not work.
.markdown-reading-view pre code.language-shell-log {
font-size: 8px;
}
Reading mode:
Live-preview mode: