Critical fix: Comprehensive input field text visibility
- Fixed all text input visibility issues across the platform - Added explicit color styles for all input types (text, email, password, etc.) - Added -webkit-text-fill-color for Safari/Chrome compatibility - Fixed placeholder text visibility - Added proper focus and disabled states - Fixed autocomplete color overrides - Created reusable Input/Textarea components - All inputs now have white background with dark text guaranteed - Resolves issues where users could only type 1-2 letters or see nothing Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,27 +8,62 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: rgb(var(--foreground-rgb));
|
color: rgb(17, 24, 39);
|
||||||
background: rgb(var(--background-rgb));
|
background: rgb(255, 255, 255);
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Force dark text for all text elements */
|
/* Input Fields - Comprehensive Fix */
|
||||||
* {
|
input[type="text"],
|
||||||
color: inherit;
|
input[type="email"],
|
||||||
}
|
input[type="password"],
|
||||||
|
input[type="tel"],
|
||||||
input,
|
input[type="number"],
|
||||||
|
input[type="search"],
|
||||||
|
input[type="url"],
|
||||||
|
input[type="date"],
|
||||||
|
input[type="time"],
|
||||||
textarea,
|
textarea,
|
||||||
select {
|
select {
|
||||||
color: rgb(17, 24, 39) !important;
|
color: #111827 !important;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
-webkit-text-fill-color: #111827 !important;
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure placeholder text is visible */
|
/* Input focus states */
|
||||||
|
input:focus,
|
||||||
|
textarea:focus,
|
||||||
|
select:focus {
|
||||||
|
color: #111827 !important;
|
||||||
|
-webkit-text-fill-color: #111827 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Placeholder text */
|
||||||
input::placeholder,
|
input::placeholder,
|
||||||
textarea::placeholder {
|
textarea::placeholder {
|
||||||
color: rgb(156, 163, 175) !important;
|
color: #9CA3AF !important;
|
||||||
opacity: 1;
|
-webkit-text-fill-color: #9CA3AF !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Disabled inputs */
|
||||||
|
input:disabled,
|
||||||
|
textarea:disabled,
|
||||||
|
select:disabled {
|
||||||
|
color: #6B7280 !important;
|
||||||
|
background-color: #F3F4F6 !important;
|
||||||
|
-webkit-text-fill-color: #6B7280 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure autocomplete doesn't override colors */
|
||||||
|
input:-webkit-autofill,
|
||||||
|
input:-webkit-autofill:hover,
|
||||||
|
input:-webkit-autofill:focus,
|
||||||
|
input:-webkit-autofill:active {
|
||||||
|
-webkit-text-fill-color: #111827 !important;
|
||||||
|
-webkit-box-shadow: 0 0 0 1000px white inset !important;
|
||||||
|
transition: background-color 5000s ease-in-out 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Font Families */
|
/* Font Families */
|
||||||
|
|||||||
98
frontend/src/components/Input.tsx
Normal file
98
frontend/src/components/Input.tsx
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||||
|
label?: string
|
||||||
|
error?: string
|
||||||
|
required?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Input: React.FC<InputProps> = ({
|
||||||
|
label,
|
||||||
|
error,
|
||||||
|
required,
|
||||||
|
className = '',
|
||||||
|
...props
|
||||||
|
}) => {
|
||||||
|
const inputClasses = `
|
||||||
|
w-full px-3 py-2
|
||||||
|
border border-gray-300 rounded-lg
|
||||||
|
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent
|
||||||
|
text-gray-900 bg-white
|
||||||
|
placeholder-gray-400
|
||||||
|
disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed
|
||||||
|
${error ? 'border-red-500 focus:ring-red-500' : ''}
|
||||||
|
${className}
|
||||||
|
`.trim()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
{label && (
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
{label}
|
||||||
|
{required && <span className="text-red-500 mr-1">*</span>}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
<input
|
||||||
|
{...props}
|
||||||
|
className={inputClasses}
|
||||||
|
style={{
|
||||||
|
color: '#111827',
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
WebkitTextFillColor: '#111827',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{error && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">{error}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||||
|
label?: string
|
||||||
|
error?: string
|
||||||
|
required?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Textarea: React.FC<TextareaProps> = ({
|
||||||
|
label,
|
||||||
|
error,
|
||||||
|
required,
|
||||||
|
className = '',
|
||||||
|
...props
|
||||||
|
}) => {
|
||||||
|
const textareaClasses = `
|
||||||
|
w-full px-3 py-2
|
||||||
|
border border-gray-300 rounded-lg
|
||||||
|
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent
|
||||||
|
text-gray-900 bg-white
|
||||||
|
placeholder-gray-400
|
||||||
|
disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed
|
||||||
|
resize-vertical
|
||||||
|
${error ? 'border-red-500 focus:ring-red-500' : ''}
|
||||||
|
${className}
|
||||||
|
`.trim()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
{label && (
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
{label}
|
||||||
|
{required && <span className="text-red-500 mr-1">*</span>}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
<textarea
|
||||||
|
{...props}
|
||||||
|
className={textareaClasses}
|
||||||
|
style={{
|
||||||
|
color: '#111827',
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
WebkitTextFillColor: '#111827',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{error && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">{error}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user