diff --git a/TAILWIND_MIGRATION.md b/TAILWIND_MIGRATION.md new file mode 100644 index 00000000..3cdf4107 --- /dev/null +++ b/TAILWIND_MIGRATION.md @@ -0,0 +1,188 @@ +# Tailwind CSS Migration Status + +## ✅ Completed (Core Infrastructure) + +### Phase 1: Setup & Foundation +- [x] Install Tailwind CSS with PostCSS and Autoprefixer +- [x] Configure `tailwind.config.js` with content globs and custom keyframes +- [x] Create `src/styles/tailwind.css` with base/components/utilities +- [x] Import Tailwind before existing CSS in `main.tsx` +- [x] Enable Tailwind preflight (CSS reset) + +### Phase 2: Base Styles Reconciliation +- [x] Add CSS variables for user-settable theme colors + - `--highlight-color-mine`, `--highlight-color-friends`, `--highlight-color-nostrverse` + - `--reading-font`, `--reading-font-size` +- [x] Simplify `global.css` to work with Tailwind preflight +- [x] Remove redundant base styles handled by Tailwind +- [x] Keep app-specific overrides (mobile sidebar lock, loading states) + +### Phase 3: Layout System Refactor ⭐ **CRITICAL FIX** +- [x] Switch from pane-scrolling to document-scrolling +- [x] Make sidebars sticky on desktop (`position: sticky`) +- [x] Update `app.css` to remove fixed container heights +- [x] Update `ThreePaneLayout.tsx` to use window scroll +- [x] Fix reading position tracking to work with document scroll +- [x] Maintain mobile overlay behavior + +### Phase 4: Component Migrations +- [x] **ReadingProgressIndicator**: Full Tailwind conversion + - Removed 80+ lines of CSS + - Added shimmer animation to Tailwind config + - Z-index layering maintained (1102) + +- [x] **Mobile UI Elements**: Tailwind utilities + - Mobile hamburger button + - Mobile highlights button + - Mobile backdrop + - Removed 60+ lines of CSS + +- [x] **App Container**: Tailwind utilities + - Responsive padding (p-0 md:p-4) + - Min-height viewport support + +## 📊 Impact & Metrics + +### Lines of CSS Removed +- `global.css`: ~50 lines removed +- `reader.css`: ~80 lines removed (progress indicator) +- `app.css`: ~30 lines removed (mobile buttons/backdrop) +- `sidebar.css`: ~30 lines removed (mobile hamburger) +- **Total**: ~190 lines removed + +### Key Achievements +1. **Fixed Core Issue**: Reading position tracking now works correctly with document scroll +2. **Tailwind Integration**: Fully functional with preflight enabled +3. **No Breaking Changes**: All existing functionality preserved +4. **Type Safety**: TypeScript checks passing +5. **Lint Clean**: ESLint checks passing +6. **Responsive**: Mobile/tablet/desktop layouts working + +## 🔄 Remaining Work (Incremental) + +The following migrations are **optional enhancements** that can be done as components are touched: + +### High-Value Components +- [ ] **ContentPanel** - Large component, high impact + - Reader header, meta info, loading states + - Mark as read button + - Article/video menus + +- [ ] **BookmarkList & BookmarkItem** - Core UI + - Card layouts (compact/cards/large views) + - Bookmark metadata display + - Interactive states + +- [ ] **HighlightsPanel** - Feature-rich + - Header with toggles + - Highlight items + - Level-based styling + +- [ ] **Settings Components** - Forms & controls + - Color pickers + - Font selectors + - Toggle switches + - Sliders + +### CSS Files to Prune +- `src/index.css` - Contains many inline bookmark/highlight styles (~3000+ lines) +- `src/styles/components/cards.css` - Bookmark card styles +- `src/styles/components/modals.css` - Modal dialogs +- `src/styles/layout/highlights.css` - Highlight panel layout + +## 🎯 Migration Strategy + +### For New Components +Use Tailwind utilities from the start. Reference: +```tsx +// Good: Tailwind utilities +