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

feat: inherit text color from theme #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SyncroIT
Copy link

@SyncroIT SyncroIT commented Dec 6, 2022

Just added a CSS rule in the stylesheet that makes the text inherit the color from the theme.

@4rchib4ld
Copy link

Installed the fork, works like a charm !

@FMJansen
Copy link

FMJansen commented Feb 6, 2023

Seems like it would also fix #60, #51; but unsure if it solves #22 🤔

@nonokh
Copy link

nonokh commented Feb 13, 2023

throws an error "failed to load highlightr plugin" for some reason for this fork.

The original plugin for some reason changes the font color to black in dark mode and messes everything up. Unable to use the highlighted text in blocks or internal links (almost invisible texts)

@rpg1d20
Copy link

rpg1d20 commented May 13, 2023

THIS IS AMAZING!! Worked like a charm ♥♥

If you used the built in installer:

  1. close obsidian
  2. go to the folder of your vault ${OBSDIAN_VAULT}.obsidian\plugins\highlightr-plugin
  3. open up main.js in you best code editor and go to line 3474 and copy in the extra lines.
  4. hit save
  5. reopen obsidian

Hopefully this helps others who are less code savvy like me.

@fatherofinvention
Copy link

Or you can just create a CSS file in your snippets directory vault/.obsidian/snippets/fix-highlighter-text.css with the contents:

mark {
    color: inherit;
}

@AMGMNPLK
Copy link

Or you can just create a CSS file in your snippets directory vault/.obsidian/snippets/fix-highlighter-text.css with the contents:

mark {
    color: inherit;
}

The fork doesn't work for me with minimal theme, and this snippet works but only in reader mode, not in preview. Any idea about what I could do?

@florenciagithub
Copy link

florenciagithub commented Nov 25, 2023

@AMGMNPLK

try

1
/* Sets the text color of all highlighted elements to theme font colour */
.markdown-preview-view mark[class^="hltr-"],
.cm-s-obsidian mark[class^="hltr-"] {
    color: inherit !important;
}

⚠️ And make sure you switch the highlighting method to "css-classes" in the settings of the Highlightr plugin for the snippet to work its magic. Once you've done that, you'll see your text shining bright white over the colorful highlights – in both preview and editor mode!

@AMGMNPLK
Copy link

AMGMNPLK commented Dec 7, 2023

Thanks @florenciagithub , but I want it with black text, because it has better contrast with the highlighting. How should I do it?

I'm using minimal theme and the plugin style settings.

@Comprehensive-Jason
Copy link

Comprehensive-Jason commented Dec 8, 2023

Thanks @florenciagithub , but I want it with black text, because it has better contrast with the highlighting. How should I do it?

I'm using minimal theme and the plugin style settings.

@AMGMNPLK Try changing 'inherit' to 'black'.

@AMGMNPLK
Copy link

AMGMNPLK commented Dec 8, 2023

I might be doing something wrong.

Do you say that I should create a snippet with this:

/* Sets the text color of all highlighted elements to theme font colour */
.markdown-preview-view mark[class^="hltr-"],
.cm-s-obsidian mark[class^="hltr-"] {
    color: inherit !important;
}

Or that I should add it in the main.js of the plugin? If that, where?

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

Successfully merging this pull request may close these issues.

9 participants