Skip to content

Soften HTML search highlight colours#11

Merged
LuisMRaimundo merged 1 commit into
mainfrom
ui/soften-html-highlight-colours
Jun 15, 2026
Merged

Soften HTML search highlight colours#11
LuisMRaimundo merged 1 commit into
mainfrom
ui/soften-html-highlight-colours

Conversation

@LuisMRaimundo

Copy link
Copy Markdown
Owner

Summary

Makes the HTML search-term highlight colours softer and lighter (pale pastels) while
keeping multiple terms distinguishable and text readable. Presentation only — no
change to match-finding, counts, ranking, or exported text content.

Changes (save_results.py)

  • Replaced the saturated per-term palette with soft pastels:
    #fff3b0, #d8f3dc, #dbeafe, #fde2e4, #f3e8ff, #ffe5d9, #e0f2fe, #fef9c3.
  • --hi CSS variable: light #fff59d -> #fff3b0; dark #4b5563 -> #fef9c3.
  • .highlight now pins dark text (--hi-text: #111827) so pastels stay readable in
    both light and dark themes, and replaces the bold + thick 2px underline with a
    subtle border-bottom: 1px solid rgba(0,0,0,0.15).

New colours vs old

Old (saturated) New (pastel)
term palette #fff59d, #ffcc80, #f48fb1, #90caf9, #a5d6a7, #ce93d8, #ffab91, #b0bec5, #ffe082, #c5e1a5, #b39ddb, #ef9a9a, #81c784, #64b5f6, #ffb74d #fff3b0, #d8f3dc, #dbeafe, #fde2e4, #f3e8ff, #ffe5d9, #e0f2fe, #fef9c3
--hi (light/dark) #fff59d / #4b5563 #fff3b0 / #fef9c3
emphasis font-weight 600 + 2px underline dark text + subtle 1px border-bottom

Tests

  • python -m unittest discover -s tests -v -> 31 passed (OK)
  • Added tests/test_html_highlight.py: highlight markup present, term text preserved,
    colours are from the pastel set (no legacy saturated colours), multiple terms keep
    distinct colours.

Match logic

Untouched. Only CSS/style classes changed; no changes to how matches are found,
counted, ranked, or to the exported text.

Manual verification

_highlight_context_html('the contract amount was paid in full', ['contract','amount'])
->
... <span class="highlight" style="background-color: #fff3b0;">contract</span> <span class="highlight" style="background-color: #d8f3dc;">amount</span> ...
(distinct pale colours, dark text).

Co-authored-by: Cursor <cursoragent@cursor.com>
@LuisMRaimundo LuisMRaimundo merged commit 0f2ca96 into main Jun 15, 2026
2 of 3 checks passed
@LuisMRaimundo LuisMRaimundo deleted the ui/soften-html-highlight-colours branch June 15, 2026 21:43
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.

2 participants