Fix: Input text was not visible #274
Fix: Input text was not visible #274Kalpana-chavhan wants to merge 2 commits intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughRemoved built-in base classes from the Input component so it now only applies the provided Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @Frontend/src/components/ui/input.tsx:
- Line 13: The Input component explicitly adds the "text-foreground" class (in
Frontend/src/components/ui/input.tsx) which fixes visibility, so remove the
redundant global rule in your global stylesheet that applies the same styling to
all input elements; delete or narrow the rule that sets text color for inputs
and ensure no other components rely on that global input selector so the
explicit "text-foreground" class remains the single source of truth.
- Around line 10-19: The Input component duplicates global base styles—remove
the global-only classes from the component-level class list and keep only
component-scoped utilities: delete bg-background, text-foreground, border-input,
px-3, py-2, ring-offset-background, and placeholder:text-muted-foreground from
the class array in the Input component and retain file:border-0
file:bg-transparent file:text-sm file:font-medium, focus-visible:outline-none
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2, and
disabled:cursor-not-allowed disabled:opacity-50 so global base styles (defined
in index.css) apply to raw inputs while component-specific file/focus/disabled
behavior remains within the Input component.
In @Frontend/src/index.css:
- Around line 126-128: Remove the redundant global placeholder rule in
Frontend/src/index.css (the input::placeholder { @apply text-muted-foreground; }
block) since the Input component already applies
placeholder:text-muted-foreground (see input.tsx line 13); delete that CSS rule
so placeholder styling is provided only by the Input component and avoid
duplicated styling.
- Around line 120-124: The global base-layer rule that targets input, textarea,
select (the CSS block using @layer base with @apply bg-background
text-foreground border-input px-3 py-2 ring-offset-background and color:
var(--foreground)) should be removed or restricted so it doesn't apply
application-wide; instead rely on the Input component's local styling (Input in
input.tsx which already includes text-foreground and padding) to fix visibility,
thus delete the global rule or narrow it to a specific namespace/class used by
your own inputs and remove the redundant color declaration if you keep any
shared rule.
🧹 Nitpick comments (1)
Frontend/src/index.css (1)
133-145: Keyframe formatting consolidated.The consolidation of keyframe steps to single-line format is a clean formatting improvement with no functional impact.
Frontend/src/components/ui/input.tsx
Outdated
| // BASE STYLES | ||
| "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background", | ||
| // TEXT VISIBILITY FIX | ||
| "text-foreground placeholder:text-muted-foreground", |
There was a problem hiding this comment.
Text visibility fix applied, but duplicated in global CSS.
The explicit text-foreground class successfully addresses the visibility issue. However, index.css lines 122-123 are applying the same styling globally to all input elements, creating redundancy.
🤖 Prompt for AI Agents
In @Frontend/src/components/ui/input.tsx at line 13, The Input component
explicitly adds the "text-foreground" class (in
Frontend/src/components/ui/input.tsx) which fixes visibility, so remove the
redundant global rule in your global stylesheet that applies the same styling to
all input elements; delete or narrow the rule that sets text color for inputs
and ensure no other components rely on that global input selector so the
explicit "text-foreground" class remains the single source of truth.
|
@Kalpana-chavhan I had already created the PR and fixed the issue . |
Description
This PR fixes the issue where input text was invisible or had poor contrast. I have updated the global CSS variables and the Input component to ensure consistent visibility across both Light and Dark modes.
Issue
Fixes or closes #272
Changes Made
inputelements usingoklchvariables.text-foregroundto the Shadcn input component to force correct text coloring.Screenshots
-Before :

-After:


Checklist
Summary by CodeRabbit
Style
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.