Skip to content

Instantly share code, notes, and snippets.

@trojblue
Created October 2, 2020 17:28
Show Gist options
  • Save trojblue/be9d52e97235b20d434c6570b50a9897 to your computer and use it in GitHub Desktop.
Save trojblue/be9d52e97235b20d434c6570b50a9897 to your computer and use it in GitHub Desktop.
Decluttering Obsidian edit mode
/* DECLUTTER;
from Obuntu Theme https://github.com/DubininDmitry/Obuntu-theme-for-Obsidian/blob/master/obsidian.css
copy&paste this to your obsidian.css to get a edit mode kind of similar to WYSIWYM
*/
/* change heading size in edit mode */
/* for better looking after enable Clutter free edit mode */
.cm-header-1 {
font-size: 30px;
color: var(--text-accent);
}
.cm-header-2 {
font-size: 26px;
}
.cm-header-3 {
font-size: 22px;
}
.cm-header-4 {
font-size: 20px;
}
.cm-header-5 {
font-size: 18px;
}
.cm-header-6 {
font-size: 18px;
color: var(--text-muted);
}
/* === Clutter free edit mode === */
/* inline formatting, link targets and [[ ]] disappears if not active line*/
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting {
display: none;
}
/* except list markers, links, images, urls and code blocks */
span.cm-image,
span.cm-link,
span.cm-url,
span.cm-formatting-list,
span.cm-formatting-code-block.cm-hmd-codeblock {
/* header hashes - span.cm-formatting-header */
display: inline !important;
}
/* hide all html tags -- IT IS COMMENTED OUT BY DEFAULT */
/* div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-tag{ display: none; } */
/* and task checkboxes */
span.cm-formatting-task {
display: inline !important;
font-family: monospace;
}
/* remove borders in iframe */
iframe {
border-width: 0;
}
/* Enlarge image on hover */
.markdown-preview-view img {
display: block;
margin-top: 20pt;
margin-bottom: 20pt;
margin-left: auto;
margin-right: auto;
width: 50%; /*experiment with values*/
transition: transform 0.25s ease;
}
.markdown-preview-view img:hover {
-webkit-transform: scale(2); /* experiment with values */
transform: scale(2);
}
/* fix background of folder-collapse-indicator */
body:not(.is-grabbing) .nav-folder-title:hover .nav-folder-collapse-indicator {
background: none;
}
/* change highlight h1 in text from outline panel or search */
/* because color the same */
.markdown-preview-view .mod-highlighted h1 {
color: white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment