Fix/search highlights - #1
Open
mdeloughry wants to merge 2 commits into
Open
Conversation
Search highlights were invisible due to two issues: - --text-selection used a hardcoded blue rgba value that was nearly invisible on the pure black background - No styles existed for CodeMirror search match classes or the global search result highlights Changes: - Replace hardcoded --text-selection with accent-aware hsla values in both dark and light themes - Add --text-highlight-bg variable for ==highlighted text== and search - Add .cm-searchMatch styles for in-editor find (Ctrl/Cmd+F) - Add .cm-searchMatch-selected for the active match with stronger opacity - Add .search-result-file-matched-text for global search panel results All highlights now use the accent color HSL variables so they adapt to the user's chosen accent color in Obsidian settings.
The previous fix used only CodeMirror class names which Obsidian doesn't apply. Add the correct Obsidian selectors: - .cm-s-obsidian span.obsidian-search-match-highlight for in-editor matches - .search-result-container --text-highlight-bg override for global search - !important on backgrounds to ensure visibility over competing styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Love the theme!
Just found the following issues.
Search highlights were invisible, when searching for words/phrases.
Changed the following:
--text-selectionwith accent ready hsla values in both dark and light themes--text-highlight-bgvariable for highlighted text and search.cm-searchMatchstyles for in-editor find.cm-searchMatch-selectedfor the active match with stronger opacity.search-result-file-matched-textfor global search panel resultsAll highlights now use the accent colour HSL variables so they adapt to the chosen accent colour in Obsidian settings.