How to remove strikethrough for checkboxes?

Thanks a lot @conname , I was also looked for this. :pray:

It works for me!!! Thanks a lot!!

Works like a charm. Thanks a lot @conname !

where is obsidian.css i can’t find it

Hi jack, the method described above has changed. It’s recommended now to put your custom CSS files into .obsidian/snippets and then activate them in the Settings->Appearance page.

More info here: Add custom styles

i’m not great with this stuff where is that?

The easiest way to get to the folder where your CSS files go is to:

  1. Go to Settings → Appearance.
  2. click the folder icon, and put your CSS file in the folder that opens up.
  3. Click the “Refresh” button to make your new file appear in Obsidian.
  4. Activate the CSS file by clicking the toggle button next to the name.

2 Likes

how do I turn this code into a CSS file?

Open your favorite text editor (for example, “Notepad” if you’re using Microsoft Windows), and paste the text into the editor. Then click File → Save As, and save it into the vault/.obsidian/snippets directory as a file ending with “.css”, for example “checkboxes.css”.

1 Like

this code doesn’t seem to be working for me

should it still work on mac if not how could i modify it to work there if not why else could it not be working?

i figured it out i accidentally added some extra characters to the word i fixed the problem thanks for your help craig

1 Like

Based on this code, is it possible to strike through checked tasks in edit mode?

2 Likes

Unfortunately, I don’t think it’s possible to style completed checklist text in edit mode.

In preview mode, the task text has a CSS tag marking it as completed, “task-list-item-is-checked”:

However in edit mode, it is simply marked as a list item “cm-list-1”:

Because there’ no class or id that marks this as a completed task in edit mode, it looks to me like there’s nothing to target with CSS, so there’s no way to style it.

I hope someone can prove otherwise!

Hope this helps,

Craig

1 Like

Thanks a lot for the detailed explanations!

I was hoping that maybe checked tasks in edit mode can display like what a strikethrough command can do.

If anyone is looking to remove strikethroughs on checked boxes in the new live preview editing mode, using this as a snippet like above worked for me:

.markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:not([data-task=" "]) {
    text-decoration:none;
    color: var(--text-normal);
}
22 Likes

This works for me as well (v.0.13.19), thanks!

thanks a lot

This is super helpful!! In my case, I combined the code from both mxmossy (Jan5) & conname Sep ('20), because I wanted to have no strike through on both the live preview and the reading view. (It works, but I don’t have css knowledge, so if for some reason combining the two is a bad idea, it would be nice to know.) Also, appreciate Craig’s (Jun’21) instructions. Thanks again.

1 Like

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