Hi there - I just put this up on reddit:
The idea is inspired by Mochi. I’ve looked all over and couldn’t find something similar for Obsidian, so I scrapped together some code from various threads to make it happen. You can adjust the colors, fade timing, etc. below.
This is working very well for me so I wanted to share. I’ve liked combing this with admonition callouts too. Below is the css code and an example card. This is my first time writing code though, so if you know css, please help us make something better!
How to use:
- Copy this code into a text file, save as a .css file in your obsidian snippets folder.
- Open the settings and enable the .css snippet
- Download SRS community plugin
- Make a new note, tag it as a #review card. This will be your flashcard.
- Change highlight hotkey to “cmd+shift+c” for full anki experience
- Use the highlight or strikethrough feature
- Mark the whole #review note Hard, Good, or Easy
Here are two snippets which work together.
I made it so the cloze only shows up in the editor. This way the pdf will still print with highlights and strikethrough and the overall note is not obscured.
- This one modifies the
strikethroughfeature to be a cloze deletion in the editor.
/*Cloze Deletion*/
/* Strikethrough in Editor */
s, .cm-strikethrough {
background: rgba(216,216,216,1);
color: rgba(0,0,0,0);
border-radius: 5px;
padding-left: 5px;
padding-right: 5px;
text-decoration: none;
transition-property: background, color;
transition-duration: 20s;
transition-timing-function: ease-out;
transition-delay: 0s;
}
s, .cm-strikethrough:hover {
background: none !important;
color: red;
cursor: none;
transition-property: background, color;
transition-duration: 0.25s;
transition-timing-function: ease-out;
transition-delay: 0.25s;
}
- This one modifies the ==highlight== function to be a cloze deletion in the editor
/*Cloze Deletion*/
/* Highlight in EDITOR */
s, .cm-s-obsidian span.cm-formatting-highlight, .cm-s-obsidian span.cm-highlight {
background: rgba(216,216,216,1);
color: rgba(0,0,0,0);
border-radius: 5px;
padding-left: 5px;
padding-right: 5px;
text-decoration: none;
transition-property: background, color;
transition-duration: 20s;
transition-timing-function: ease-out;
transition-delay: 0s;
}
s, .cm-s-obsidian span.cm-formatting-highlight:hover, .cm-s-obsidian span.cm-highlight:hover {
background: none !important;
color: red;
cursor: none;
transition-property: background, color;
transition-duration: 0.25s;
transition-timing-function: ease-out;
transition-delay: 0.25s;
}