Is there a way to show whitespace with CSS?
I saw the Show Whitespace plugin, but I would like to do the same thing with a CSS snippet. DeepSeek didn’t help me.
Is there a way to show whitespace with CSS?
I saw the Show Whitespace plugin, but I would like to do the same thing with a CSS snippet. DeepSeek didn’t help me.
This should do the trick …
/* Whitespace */
.cm-trailing-space-a::before,
.cm-trailing-space-b::before,
.cm-trailing-space-new-line::before {
content: "·";
color: var(--list-marker-color);
}
Cheers, Marko
EDIT:
color
I choose first grey one on my dark theme … so it’s up to you to find better!
This doesn’t work for me, idk why.
In Reading or Editing mode? Or none?
Cheers, Marko
In Editing mode, I changed color to #FFFFFF (I have dark theme)
Disabling all my custom CSS snippet and community plugin didn’t help
Can you try with !important
at both content
and color
…
Do you see it applied in the inspector?
It should be applied to the ::before
…
Cheers, Marko
After restarting the PC, it suddenly decided to work, although I rebooted Obsidian several times.
However, working with the plugin is still different from this function. Spaces are displayed only when there are two or more of them (it doesn’t work with one space), and spaces between words in a sentence are also not displayed.
You could try this as well (for the editor):
I wrote about it in my first topic message
I saw the Show Whitespace plugin, but I would like to do the same …
Yes, with CSS, you can’t achieve the same level of quality with all those “hidden signs” as you can with plugins (TS). It’s the way MD is rendered in HTML. Give it a try with the one that @ariehen suggested.
Cheers, Marko
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.