chetachiezikeuzor / Highlightr-Plugin

A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier 🎨.
Mozilla Public License 2.0
620 stars 35 forks source link

feat: inherit text color from theme #59

Open SyncroIT opened 1 year ago

SyncroIT commented 1 year ago

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

4rchib4ld commented 1 year ago

Installed the fork, works like a charm !

FMJansen commented 1 year ago

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

nonokh commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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 commented 10 months ago

@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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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?