-
Notifications
You must be signed in to change notification settings - Fork 9
fix: force input text color to black for dark mode visibility #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
IamLRBA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Atharva1015, the approach is straightforward and accurate!
As a small improvement, I think these would be great:
- Align the text color with our project’s unified design tokens system, you could take time and read the tokens documentation here and examples of using them in the Formulas app here.
I believe this should help you even for future contributions rather than using hardcoded values, to keep styling consistent and future-proof.
- Screenshots aren’t strictly required for this fix, but a quick before/after image could add extra clarity for reviewers.
Thanks again for the initiative and interest!
|
Thanks for pointing that out! I found colors.neutral.black in the design tokens and have updated the styles to use that instead of the hardcoded hex value. The PR is updated! |
IamLRBA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Atharva1015
Thanks for making the change! You're on the right track.
You just need to use tokens from the official @ode/tokens package instead of the local theme file.
What to change:
- Import the tokens: Add
import { tokens } from '@ode/tokens/dist/react-native/tokens'; to your imports. - Otherwise, it would result into an error because of a wrong import!
How to test:
From the packages/tokens directory, run npm install and npm run build to ensure the tokens package is built locally. Then, you can verify the color works in your Formulus component.
Your change will guarantee visibility. The key is just sourcing it from the right place.
Let me know if you have any questions!
Sorry for dragging this too long, but we can also have fun with code and its rules right buddy? (>ᴗ•) !
|
Hello @IamLRBA !
|
|
Nice work checking the @ode/tokens package and successfully building it! |
|
Hi @IamLRBA. Thanks for the feedback! |
Closes #6
Title: fix(settings): force input text color to black for dark mode visibility
Description: This PR fixes the usability issue where input text becomes invisible (white-on-white) when the device is in Dark Mode.
The bug was identified by analyzing SettingsScreen.tsx, I found that the inputContainer has a static light background (colors.neutral[50]), but the input text was using a dynamic color (colors.neutral[900]).
Light Mode: Background is White, Text is Dark. (OK)
Dark Mode: Background stays White (Static), but Text turns White (Dynamic). (Invisible)
The Fix: I have updated the input style to use a hardcoded black color (#000000). Since the container background is always light regardless of the theme, the text must always be black to ensure contrast in both modes.