Steps to reproduce
Add the following CSS as a snippet and activate that snippet:
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection,
::selection {
background-color: red;
color: white;
text-decoration: underline;
}
.HyperMD-codeblock.CodeMirror-line::selection,
.HyperMD-codeblock.CodeMirror-line > span::selection,
.HyperMD-codeblock.CodeMirror-line > span > span::selection,
::selection {
background-color: blue;
color: white;
text-decoration: underline;
}
Alternatively, add it to a theme’s CSS file and restart Obsidian.
Expected result
Text selection should be red with white text outside of code blocks and blue with white text inside code blocks.
Actual result
Text selection does not change (i.e. light blue for the “None” theme).
Environment
- Operating system: macOS Big Sur
- Obsidian version: v0.11.3
Do we maybe need a CodeMirror addon like this one?