Skip to content

Conversation

ykdojo
Copy link
Contributor

@ykdojo ykdojo commented Sep 2, 2025

Summary

  • Adds dark mode CSS variables for Algolia DocSearch modal
  • Uses Material Design variables for consistent theming with existing dark mode
  • Implements subtle shadow and background colors appropriate for dark theme
  • Uses consistent dark mode selector pattern matching existing codebase

Test plan

  • Test search modal in light mode (unchanged)
  • Test search modal in dark mode (now properly styled)
  • Verify colors match overall Material Design dark theme

Before

image image

After

image image

- Add dark mode CSS variables for DocSearch modal
- Use Material Design variables for consistent theming
- Implement subtle shadow for better dark mode appearance
- Apply appropriate background colors and text contrast
@github-actions github-actions bot added the docs label Sep 2, 2025
@ykdojo ykdojo marked this pull request as ready for review September 2, 2025 15:45
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR enhances the Daft documentation site by adding dark mode support for the Algolia DocSearch modal component. The change modifies the docs/css/docsearch.css file to include CSS variables that customize the search modal's appearance when Material Design's dark theme is active.

The implementation targets the specific dark mode configuration used by the Daft documentation site ([data-md-color-scheme="slate"][data-md-color-primary="black"]) and overrides DocSearch's default styling with Material Design variables. This ensures visual consistency between the search modal and the rest of the documentation site's dark theme.

The CSS variables control various aspects of the search modal including text colors, backgrounds, shadows, and hover states. Rather than hardcoding dark mode colors, the implementation leverages Material Design's built-in CSS variables like var(--md-default-fg-color) and var(--md-default-bg-color), which automatically adapt to the site's theming system. This approach maintains the existing light mode functionality while providing proper contrast and readability in dark mode.

The change fits seamlessly into the documentation infrastructure, enhancing the user experience for developers who prefer dark mode when browsing the Daft documentation.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only affects CSS styling for the documentation site
  • Score reflects the isolated nature of CSS changes with no impact on core functionality or breaking changes
  • No files require special attention - the single CSS file change is straightforward and well-implemented

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@desmondcheongzx desmondcheongzx merged commit ce3fd01 into main Sep 2, 2025
30 checks passed
@desmondcheongzx desmondcheongzx deleted the fix/algolia-dark-mode branch September 2, 2025 16:02
venkateshdb pushed a commit to venkateshdb/Daft that referenced this pull request Sep 6, 2025
## Summary
- Adds dark mode CSS variables for Algolia DocSearch modal
- Uses Material Design variables for consistent theming with existing
dark mode
- Implements subtle shadow and background colors appropriate for dark
theme
- Uses consistent dark mode selector pattern matching existing codebase

## Test plan
- [x] Test search modal in light mode (unchanged)  
- [x] Test search modal in dark mode (now properly styled)
- [x] Verify colors match overall Material Design dark theme

## Before

<img width="595" height="222" alt="image"
src="https://github.com/user-attachments/assets/16dd3d15-53fe-43fc-9d00-80150f083145"
/>

<img width="1049" height="345" alt="image"
src="https://github.com/user-attachments/assets/2f1a91cf-55ea-4df7-ad28-ddd9b114a48d"
/>

## After

<img width="584" height="228" alt="image"
src="https://github.com/user-attachments/assets/2be1afe8-2ccf-47c2-a13e-9cc525debd35"
/>

<img width="1032" height="341" alt="image"
src="https://github.com/user-attachments/assets/bcb98d6c-073e-4ed2-b1b1-7f86f03ec5a7"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants