Custom CSS Doesn't Work After Upgrading

Hi! I’m heavily relying on this custom css snippet to disable wrapping lines in the code block. It worked fine until recent upgrade.

.markdown-source-view.is-readable-line-width .CodeMirror {
    max-width: 2000px;
}
.markdown-preview-view.is-readable-line-width .markdown-preview-sizer{
    max-width: 2000px;
}

.markdown-source-view { font-family: 'Sarasa Term SC', monospace; }

/*un-wrap code*/
.nowrapcode .HyperMD-codeblock {
    white-space: nowrap;
}

/*scroll codeblock in read mode*/
.nowrapcode .markdown-reading-view code[class*="language-"] {
    overflow-x: scroll;
    white-space: pre;
    padding: 15px 0px;
}

Typically I used

---
cssclass: nowrapcode
---

to enable it.

I looked at the id of the container but didn’t see anything different. But maybe I missed something since I’m not an expert in js/css. Any hints would be highly appreciated.

You probably just need to use the key cssclasses instead of cssclass :blush:

cssclass, as of Obsidian 1.9.10, isn’t supported anymore …
See the Breaking changes paragraph in Obsidian 1.9.10 changelog

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.