Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A CSS Snippet to work with newer versions of Obsidian #22

Open
loikein opened this issue Aug 25, 2023 · 1 comment
Open

A CSS Snippet to work with newer versions of Obsidian #22

loikein opened this issue Aug 25, 2023 · 1 comment

Comments

@loikein
Copy link

loikein commented Aug 25, 2023

Edit in 2024: You may find ebullient/obsidian-show-whitespace-cm6 useful.


Hi folks, I have gathered the following snippet to make this plugin work with Obsidian v1.3.7 (more or less, I forgot how it used to work and wrote it for my own needs). Please feel free to use and make changes. Cheers.

Edit: The br fixes do not work on iOS.

Edit 2: Added new line indicators for non-empty lines.

Please consult the doc if you are new to the snippets.

Details
body.plugin-cm-show-whitespace [class*=cm-trailing-space]::after,
body.plugin-cm-show-whitespace [class*=cm-trailing-space]::before {
  color: var(--text-muted);
}

.cm-line br {
  content: " ";
  display: inline-block;
}

.cm-line br::after,
.cm-line:not(:has(br)):not(:has(.cm-trailing-space-new-line))::after {
  content: var(--newlineChar);
  white-space: pre;
  pointer-events: none;
  color: var(--text-muted);
  font-weight: normal;
  opacity: 0.5;
  padding-inline-start: 2px;
}
@notDavid
Copy link

notDavid commented Nov 14, 2023

Newlines work, but it doesn't show whitespaces for me.
If someone gets it working, please post the solution here... thank you!

-- Obsidian 1.4.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants