Hello,
I want to have dark-mode code in a light-mode Obsidian theme. I’ve looked for themes that have this but didn’t find any. I put together the following css code snippet that does the trick for the ‘default’ obsidian style, by looking through the default app.css and copying colors:
/* In light mode, render code using dark-mode colors */
.HyperMD-codeblock, :not(pre) > code[class*="language-"], pre[class*="language-"] {
--code-background: #242424;
--code-normal: #b3b3b3;
--code-comment: #666666;
--code-function: #e0de71;
--code-important: #e9973f;
--code-keyword: #fa99cd;
--code-operator: #fb464c;
--code-property: #53dfdd;
--code-punctuation: #b3b3b3;
--code-string: #44cf6e;
--code-tag: #fb464c;
--code-value: #a882ff;
--caret-color: #dadada;
}
/* ??? */
body {
--caret-color: var(--caret-color);
}
If anyone knows of a better way to do this, that would be great.