|
| 1 | +# InkImage Component - Style Alignment Result |
| 2 | + |
| 3 | +## Status: ✅ Complete |
| 4 | + |
| 5 | +Successfully aligned the `inkImage` component's expand variant with Figma Design using design tokens. |
| 6 | + |
| 7 | +## Changes Made |
| 8 | + |
| 9 | +### 1. **inkImage.scss** - Design Token Implementation |
| 10 | + |
| 11 | +All hardcoded values replaced with design tokens: |
| 12 | + |
| 13 | +| Element | Before | After | |
| 14 | +|---------|--------|-------| |
| 15 | +| Thumbnail border-radius | `4px` | `sys-var(radius, xs)` | |
| 16 | +| Thumbnail hover shadow | `0 2px 8px rgba(0,0,0,0.12)` | Improved with tokens | |
| 17 | +| Thumbnail focus outline | `var(--color-primary, #0066cc)` | `sys-var(color, surface, primary)` | |
| 18 | +| **Expanded container** | `90vw/90vh, max 1200×800px, centered` | **Full viewport (100vw×100vh), full coverage** | |
| 19 | +| Expanded background | `#fff` | `sys-var(color, surface, base)` | |
| 20 | +| Expanded padding | `16px 20px` (hardcoded) | `sys-var(space, xl) sys-var(space, lg)` (56px vertical, 32px horizontal) | |
| 21 | +| Header title color | `#1f2937` | `sys-var(color, text, base)` | |
| 22 | +| Close button color | `#6b7280` | `sys-var(color, text, muted)` | |
| 23 | +| Close button hover bg | `#f3f4f6` | `sys-var(color, surface, subtle-hover)` | |
| 24 | +| Close button active bg | `#e5e7eb` | `sys-var(color, surface, base-hover)` | |
| 25 | +| Content background | `#f9fafb` | `sys-var(color, surface, base)` | |
| 26 | +| Content padding | `20px` | `0` (fills available space) | |
| 27 | +| Image object-fit | `contain` ✅ | `contain` ✅ (preserved) | |
| 28 | +| Footer border | `1px solid #e5e7eb` | Removed (no divider) | |
| 29 | +| Footer background | `#f9fafb` | `sys-var(color, surface, base)` | |
| 30 | + |
| 31 | +### 2. **inkImage.vue** - Template Improvements |
| 32 | + |
| 33 | +- Added comments clarifying the full viewport expand view |
| 34 | +- Improved comment on image container ("maintains aspect ratio and fills available space") |
| 35 | +- Structure remains unchanged; functionality preserved |
| 36 | +- All slots, v-model bindings, and event handlers intact |
| 37 | + |
| 38 | +### 3. **Design Token Alignment with Figma** |
| 39 | + |
| 40 | +Mapped Figma tokens to InKCre system: |
| 41 | + |
| 42 | +| Figma Token | InKCre Token | Value | |
| 43 | +|------------|--------------|-------| |
| 44 | +| `space/lg` | `sys-var(space, lg)` | 32px (horizontal padding) | |
| 45 | +| `space/xl` | `sys-var(space, xl)` | 56px (vertical padding) | |
| 46 | +| `color/scrim/base` | Uses InkScrim component | #c6c6c6 (overlay) | |
| 47 | + |
| 48 | +## Key Layout Changes |
| 49 | + |
| 50 | +### Before (Constrained Modal) |
| 51 | + |
| 52 | +``` |
| 53 | +- Fixed dimensions: 90vw × 90vh |
| 54 | +- Max size: 1200px × 800px |
| 55 | +- Centered positioning |
| 56 | +- White background |
| 57 | +- Hardcoded spacing |
| 58 | +``` |
| 59 | + |
| 60 | +### After (Full Viewport Lightbox) ✅ |
| 61 | + |
| 62 | +``` |
| 63 | +- Full viewport: 100vw × 100vh |
| 64 | +- Fixed positioning with inset: 0 |
| 65 | +- Theme-aware background |
| 66 | +- Design token spacing: 56px vertical / 32px horizontal |
| 67 | +- Proper flex layout for content scaling |
| 68 | +``` |
| 69 | + |
| 70 | +## Features Preserved |
| 71 | + |
| 72 | +✅ Click-to-expand functionality |
| 73 | +✅ Close button with ESC key support |
| 74 | +✅ Click scrim to close |
| 75 | +✅ Optional title/caption in header |
| 76 | +✅ Custom slots (thumbnail, expanded-header, expanded-footer) |
| 77 | +✅ Lazy loading support |
| 78 | +✅ Error handling |
| 79 | +✅ Full accessibility (ARIA labels, focus management) |
| 80 | +✅ Responsive design |
| 81 | +✅ Theme-aware colors (light/dark mode ready) |
| 82 | + |
| 83 | +## Design System Compliance |
| 84 | + |
| 85 | +✅ No hardcoded colors |
| 86 | +✅ All spacing uses tokens |
| 87 | +✅ All typography sizes from token system |
| 88 | +✅ Elevation tokens ready for use |
| 89 | +✅ Theme-aware (`sys-var()` for all colors) |
| 90 | +✅ Follows InKCre design patterns |
| 91 | +✅ Consistent with other components (inkButton, inkPopup, etc.) |
| 92 | + |
| 93 | +## Files Modified |
| 94 | + |
| 95 | +1. [inkImage.scss](packages/web-design/src/components/inkImage/inkImage.scss) |
| 96 | +2. [inkImage.vue](packages/web-design/src/components/inkImage/inkImage.vue) |
| 97 | + |
| 98 | +## Testing |
| 99 | + |
| 100 | +- Vue file: ✅ No syntax errors |
| 101 | +- SCSS file: ✅ Valid token references |
| 102 | +- All design tokens properly formatted: ✅ |
| 103 | +- Component structure maintained: ✅ |
0 commit comments