fix: Neutral Color Contrast Issues in DaisyUI Theme Generator#4
Open
abidra wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
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)