|
| 1 | +# AI Development Notes |
| 2 | +*Persistent notes for AI assistants working on the Aetheria project* |
| 3 | + |
| 4 | +## 🎨 CSS/SCSS Styling Guidelines |
| 5 | + |
| 6 | +### **CRITICAL: CSS Architecture Pattern** |
| 7 | +**ALWAYS follow this hierarchy when organizing SCSS:** |
| 8 | + |
| 9 | +1. **Variables** - All SCSS variables at the top |
| 10 | +2. **Element Styles** - Base typography and layout elements (`p`, `h1-h6`, `a`, `button`, `table`, etc.) |
| 11 | +3. **Class-Based Overrides** - Component and utility classes (`.container`, `.responsive-table`, etc.) |
| 12 | +4. **Media Queries** - Responsive styles at the end |
| 13 | + |
| 14 | +### **Styling Philosophy** |
| 15 | +- **Element-first styling** - Set base styles on HTML elements |
| 16 | +- **Classes for overrides** - Use classes for variations and components |
| 17 | +- **IDs as last resort** - Avoid ID selectors (maintain low specificity) |
| 18 | +- **Proper nesting** - Use SCSS nesting logically, don't over-nest |
| 19 | + |
| 20 | +### **Active States & Accessibility** |
| 21 | +- **Always specify text color** on hover/active states (e.g., `color: $white`) |
| 22 | +- **Include .active class** styling for navigation elements |
| 23 | +- **Enhanced :active states** with background changes and visual feedback |
| 24 | +- **High contrast** - Ensure readable text on all backgrounds |
| 25 | + |
| 26 | +### **SCSS Best Practices** |
| 27 | +- **Meaningful variable names** - Use semantic naming like `$primary-color`, `$text-color` |
| 28 | +- **Consistent color palette** - Stick to defined variables |
| 29 | +- **Modern syntax** - Prefer newer SCSS functions when possible (though legacy OK for now) |
| 30 | + |
| 31 | +## 📱 Responsive Design Patterns |
| 32 | + |
| 33 | +### **Table Responsiveness** |
| 34 | +- **ResponsiveTable component** - Use JavaScript-controlled responsive tables instead of CSS-only |
| 35 | +- **Priority-based columns** - Hide less important columns first on smaller screens |
| 36 | +- **Card layout fallback** - Switch to card layout for mobile when needed |
| 37 | + |
| 38 | +### **Mobile-First Approach** |
| 39 | +- **Base styles** work on mobile |
| 40 | +- **Progressive enhancement** for larger screens |
| 41 | +- **Touch-friendly** interactive elements |
| 42 | + |
| 43 | +## 🏗️ Component Architecture |
| 44 | + |
| 45 | +### **SolidJS Patterns** |
| 46 | +- **TypeScript interfaces** for component props |
| 47 | +- **Reactive data** with createSignal/createMemo |
| 48 | +- **Clean separation** between data and presentation |
| 49 | + |
| 50 | +### **File Organization** |
| 51 | +- **Element styles first** in SCSS |
| 52 | +- **Component-specific classes** grouped logically |
| 53 | +- **Responsive styles** at the end of file |
| 54 | + |
| 55 | +## 🚀 Build & Performance |
| 56 | + |
| 57 | +### **Current Metrics** *(as of October 2025)* |
| 58 | +- **CSS bundle size**: ~12.34 kB (reduced from 16.36 kB via reorganization) |
| 59 | +- **Build tool**: Vite 7.1.10 |
| 60 | +- **SCSS compiler**: Dart Sass (with deprecation warnings for old color functions) |
| 61 | + |
| 62 | +### **Performance Considerations** |
| 63 | +- **Smaller CSS bundles** through proper organization |
| 64 | +- **Efficient selectors** - element selectors are faster than class selectors |
| 65 | +- **Minimal specificity** wars through proper hierarchy |
| 66 | + |
| 67 | +## 🔧 Development Workflow |
| 68 | + |
| 69 | +### **When Making CSS Changes** |
| 70 | +1. **Check current structure** before editing |
| 71 | +2. **Follow the hierarchy** - element → class → media queries |
| 72 | +3. **Test build** after major changes |
| 73 | +4. **Verify contrast** on active/hover states |
| 74 | + |
| 75 | +### **File Structure Maintained** |
| 76 | +``` |
| 77 | +/site/src/ |
| 78 | + ├── index.scss (main stylesheet - KEEP ORGANIZED!) |
| 79 | + ├── components/ (SolidJS components) |
| 80 | + └── pages/ (page components using ResponsiveTable) |
| 81 | +``` |
| 82 | + |
| 83 | +## 📝 Known Issues & Technical Debt |
| 84 | + |
| 85 | +### **SCSS Deprecation Warnings** |
| 86 | +- `lighten()` and `darken()` functions deprecated |
| 87 | +- Should eventually migrate to `color.adjust()` or `color.scale()` |
| 88 | +- Not critical - still works, just shows warnings |
| 89 | + |
| 90 | +### **Responsive Table Pages** |
| 91 | +- **Converted to ResponsiveTable**: equipment.tsx, magic.tsx, classes.tsx, religion.tsx |
| 92 | +- **Still need conversion**: alignment.tsx, politics.tsx, relationships.tsx (if they have tables) |
| 93 | + |
| 94 | +## 🎯 Future Considerations |
| 95 | + |
| 96 | +### **Potential Improvements** |
| 97 | +- **Modern SCSS functions** - Update deprecated color functions |
| 98 | +- **CSS custom properties** - Consider CSS variables for theming |
| 99 | +- **Component CSS** - Evaluate CSS modules or styled-components if needed |
| 100 | + |
| 101 | +### **Accessibility Enhancements** |
| 102 | +- **Focus states** - Ensure keyboard navigation is clear |
| 103 | +- **Color contrast** - Verify WCAG compliance |
| 104 | +- **Screen reader** - Test with assistive technologies |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +*Last updated: October 25, 2025* |
| 109 | +*Remember: This file helps maintain consistency across AI sessions!* |
0 commit comments