Skip to content

fix: Neutral Color Contrast Issues in DaisyUI Theme Generator#4

Open
abidra wants to merge 1 commit into
mainfrom
fix/bug-neutral-content-color
Open

fix: Neutral Color Contrast Issues in DaisyUI Theme Generator#4
abidra wants to merge 1 commit into
mainfrom
fix/bug-neutral-content-color

Conversation

@abidra
Copy link
Copy Markdown
Collaborator

@abidra abidra commented Apr 13, 2025

Issue

The neutral color in the light theme was set to oklch(20.5% 0 0), which is a very dark color. This caused a contrast issue because the theme generator was treating it as a dark color and generating light content text (oklch(97% 0.001 56.259)), which resulted in poor visibility in the light theme.

Changes Made

Changed light theme neutral color from oklch(20.5% 0 0) (dark) to oklch(75% 0 0) (light)
Changed dark theme neutral color from oklch(97% 0 0) (very light) to oklch(25% 0 0) (dark)
Added special handling in generateContentColor function for neutral colors (very low chroma) to ensure proper contrast

Technical Details

The color utility functions now properly handle neutral colors with low chroma values, distinguishing between dark and light backgrounds to generate appropriate content colors. This ensures good readability across both light and dark themes.

Testing

Verified that the neutral colors now correctly generate contrasting content colors:
Light theme neutral (75% lightness) → dark content (3% lightness)
Dark theme neutral (25% lightness) → light content (97% lightness)

@abidra abidra self-assigned this Apr 13, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
livecanvas-builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2025 1:23pm

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.

1 participant