- Created comprehensive INPUT_COMPONENT_STYLING_AUDIT.md - Documented all 25+ styling classes with categorization - Identified 5 key issues: - Complex focus state (ring + border redundant) - Unnecessary backdrop-blur-sm decoration - Overly broad transition-all - Subtle hover effect - Complex border radius - Analyzed usage: 100+ files import Input component - Provided Priority 1-3 recommendations for simplification - Created proposed simplified version with Kodo colors - Ready for Action 9.5.1.2 (remove unnecessary decorations)
7.2 KiB
Input Component Styling Audit
Generated: 2025-01-27
Purpose: Document current styling of Input component for simplification
Action: 9.5.1.1
File: apps/web/src/components/ui/input.tsx
Executive Summary
The Input component currently has complex styling with multiple decorative effects, transitions, and state-specific classes. This audit documents all styling classes and identifies opportunities for simplification.
Current Styling Analysis
Component Location
- File:
apps/web/src/components/ui/input.tsx - Line: 13 (className string)
- Total Classes: 25+ individual Tailwind classes in a single string
Complete Class Breakdown
Layout & Sizing
| Class | Purpose | Status |
|---|---|---|
flex |
Flexbox layout | ✅ Essential |
h-10 |
Fixed height (40px) | ✅ Essential |
w-full |
Full width | ✅ Essential |
Border & Shape
| Class | Purpose | Status |
|---|---|---|
rounded-xl |
Large border radius (12px) | ⚠️ Could simplify to rounded-lg |
border |
Border base | ✅ Essential |
border-white/10 |
Default border (10% opacity white) | ✅ Essential |
hover:border-white/15 |
Hover border (15% opacity white) | ⚠️ Subtle, could remove |
Background
| Class | Purpose | Status |
|---|---|---|
bg-black/20 |
Default background (20% opacity black) | ✅ Essential |
focus-visible:bg-black/30 |
Focus background (30% opacity black) | ⚠️ Could simplify |
backdrop-blur-sm |
Backdrop blur effect | ❌ Unnecessary decoration |
Text & Typography
| Class | Purpose | Status |
|---|---|---|
text-sm |
Small text size | ✅ Essential |
text-white |
White text color | ✅ Essential |
placeholder:text-kodo-secondary/50 |
Placeholder text color | ✅ Essential |
Padding
| Class | Purpose | Status |
|---|---|---|
px-4 |
Horizontal padding (16px) | ✅ Essential |
py-2.5 |
Vertical padding (10px) | ✅ Essential |
Focus State
| Class | Purpose | Status |
|---|---|---|
focus-visible:outline-none |
Remove default outline | ✅ Essential |
focus-visible:ring-2 |
Focus ring width | ❌ Should be border instead |
focus-visible:ring-kodo-cyan |
Focus ring color | ❌ Should be border instead |
focus-visible:border-kodo-cyan/50 |
Focus border (50% opacity cyan) | ⚠️ Redundant with ring |
ring-offset-kodo-void |
Ring offset color | ❌ Not needed if using border |
Disabled State
| Class | Purpose | Status |
|---|---|---|
disabled:cursor-not-allowed |
Disabled cursor | ✅ Essential |
disabled:opacity-50 |
Disabled opacity | ✅ Essential |
Transitions
| Class | Purpose | Status |
|---|---|---|
transition-all |
Transition all properties | ⚠️ Could be more specific |
duration-200 |
Transition duration (200ms) | ✅ Essential |
File Input Styling
| Class | Purpose | Status |
|---|---|---|
file:border-0 |
Remove file input border | ✅ Essential |
file:bg-transparent |
Transparent file input bg | ✅ Essential |
file:text-sm |
File input text size | ✅ Essential |
file:font-medium |
File input font weight | ✅ Essential |
Issues Identified
1. Complex Focus State ❌
Current: Uses both ring and border for focus
focus-visible:ring-2 focus-visible:ring-kodo-cyan(ring)focus-visible:border-kodo-cyan/50(border)
Issue: Redundant styling - ring and border both indicate focus
Recommendation: Use only border-kodo-cyan for focus (no ring, no glow)
2. Unnecessary Backdrop Blur ❌
Current: backdrop-blur-sm
Issue: Adds visual complexity without clear benefit
Recommendation: Remove backdrop blur
3. Overly Broad Transitions ⚠️
Current: transition-all
Issue: Transitions all properties, including unnecessary ones
Recommendation: Use specific transitions: transition-colors transition-opacity
4. Subtle Hover Effect ⚠️
Current: hover:border-white/15 (changes from 10% to 15% opacity)
Issue: Very subtle, may not be noticeable
Recommendation: Either remove or make more noticeable
5. Complex Border Radius ⚠️
Current: rounded-xl (12px)
Issue: Larger than typical inputs
Recommendation: Consider rounded-lg (8px) for consistency
Usage Analysis
Import Count
- Total imports: 100+ files use the Input component
- Primary usage: Forms, search bars, modals, settings pages
Key Usage Patterns
- Forms: Login, Register, Profile, Settings
- Search: Track search, playlist search, general search
- Modals: Create playlist, add collaborator, API keys
- Settings: Account, security, cloud integration
Alternative Input Components
AuthInput(features/auth/components/AuthInput.tsx) - Custom styled input for authSearchInput(components/ui/input.tsx) - Wrapper around Input with search iconcomponents/base/Input.tsx- Legacy base component (minimal styling)
Recommendations
Priority 1: Remove Complex Decorations
- ✅ Remove
backdrop-blur-sm- Unnecessary visual effect - ✅ Simplify focus state - Use
border-kodo-cyanonly (no ring, no glow) - ✅ Remove
ring-offset-kodo-void- Not needed with border-only focus
Priority 2: Simplify Transitions
- ✅ Replace
transition-allwith specific transitions - ✅ Keep
duration-200for consistency
Priority 3: Optional Simplifications
- ⚠️ Consider
rounded-lginstead ofrounded-xl - ⚠️ Evaluate hover effect necessity
- ⚠️ Simplify focus background change (may not be needed)
Proposed Simplified Styling
Minimal Clean Version
className={cn(
'flex h-10 w-full rounded-lg border border-kodo-steel',
'bg-kodo-graphite px-4 py-2.5 text-sm',
'text-kodo-text-main placeholder:text-kodo-content-dim',
'focus-visible:outline-none focus-visible:border-kodo-cyan',
'disabled:cursor-not-allowed disabled:opacity-50',
'transition-colors duration-200',
'file:border-0 file:bg-transparent file:text-sm file:font-medium',
className,
)}
Key Changes
- ✅ Removed
backdrop-blur-sm - ✅ Removed
ringandring-offset(using border only) - ✅ Simplified focus to
border-kodo-cyanonly - ✅ Changed
transition-alltotransition-colors - ✅ Changed
rounded-xltorounded-lg - ✅ Removed hover border change
- ✅ Removed focus background change
- ✅ Simplified colors to use Kodo design system
Next Steps
- Action 9.5.1.2: Remove unnecessary decorations (backdrop-blur, complex focus)
- Action 9.5.1.3: Simplify styling classes (transitions, border radius)
- Action 9.5.1.4: Update focus state to cyan border only (no ring/glow)
- Action 9.5.1.5: Remove remaining unnecessary decorations
- Action 9.5.1.6: Visual testing
Validation Checklist
- Current styling documented ✅
- All classes identified and categorized ✅
- Issues identified ✅
- Recommendations provided ✅
- Proposed simplified version created ✅
Note: This audit focuses on the components/ui/input.tsx component. Other input components (AuthInput, SearchInput) may have different styling and should be audited separately if needed.