Skip to content

DocSearch hit text becomes invisible on hover due to white font on white background #81

@codewithmunmun

Description

@codewithmunmun

Bug Report 🐛

This issue occurs in the docsearch hits widget when the website is using dark theme. On hovering over a search result, both the text and background turn white, which makes the text unreadable. This creates a poor user experience and prevents users from reading the search results on hover.

Expected Behavior

When hovering over a search hit, the text should remain clearly visible against the background.

Current Behavior

On hovering over a search hit in dark theme, both the text and the background become white. This makes the search result text invisible and unreadable, preventing users from viewing the hovered item.

Possible Solution

In dark theme, the hover state uses --docsearch-hit-active-color for text, which currently resolves to white. Since the background on hover is also white, the text becomes invisible.
To fix this, the hover text color should be adjusted to maintain contrast.

Steps to Reproduce

  1. Open the website in dark theme.
  2. Perform a search using the docsearch hits widget.
  3. Hover over one of the search result hits.
  4. Observe that both the text and the background turn white, making the text unreadable.

Desktop

  • OS: Ubuntu 24.04.2
  • Browser: Firefox, Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions