Skip to content

Commit

Permalink
CiteHighlighter: fix white text in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Jul 15, 2024
1 parent b6f85ac commit 7eaf170
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions CiteHighlighter/CiteHighlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,19 @@ class CiteHighlighter {
// [title="source" i]... the "i" part is not working in :has() for some reason
// use .toLowerCase() for now
// using .addClass() instead of .css() or .attr('style') because I'm having issues getting medrs to override arXiv/Wikidata/other red sources
this.$( 'li[id^="cite_note-"]' ).has( 'a[href*="/' + source.toLowerCase() + '"]' ).addClass( 'cite-highlighter-' + color );
this.$( 'li[id^="cite_note-"]' ).has( 'a[href*=".' + source.toLowerCase() + '"]' ).addClass( 'cite-highlighter-' + color );
this.$( 'li[id^="cite_note-"]' )
.has( 'a[href*="/' + source.toLowerCase() + '"]' )
.addClass( [
'cite-highlighter-' + color,
// in dark mode, make foreground text black instead of white
'notheme'
] );
this.$( 'li[id^="cite_note-"]' )
.has( 'a[href*=".' + source.toLowerCase() + '"]' )
.addClass( [
'cite-highlighter-' + color,
'notheme'
] );
}

highlightUnorderedListItem( source, color ) {
Expand Down

0 comments on commit 7eaf170

Please sign in to comment.