Migrate StarterPackCatalogModal to design tokens#640
Conversation
Replace all hardcoded light-mode Tailwind color classes (bg-white, text-gray-*, border-gray-*, bg-blue-*, etc.) with scoped CSS classes that reference --td-* design tokens from design-tokens.css. This ensures the modal respects dark/light theme switching. Closes #612
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Self-review of #640Completeness check
Token mapping correctness
Potential concerns
Build verification
|
There was a problem hiding this comment.
Code Review
This pull request migrates the StarterPackCatalogModal.vue component from hardcoded Tailwind utility classes to a centralized design token system using semantic CSS variables. The changes include replacing inline classes with custom scoped classes (e.g., sp-panel, sp-btn-primary) and adding a comprehensive <style> block. Feedback focuses on improving the consistency and accessibility of these new styles, specifically regarding hardcoded backdrop colors, low-contrast borders on error boxes, redundant class definitions, and accessibility concerns for disabled button states.
| <style scoped> | ||
| /* ── Backdrop ── */ | ||
| .sp-backdrop { | ||
| background: rgba(0, 0, 0, 0.5); |
There was a problem hiding this comment.
The backdrop background uses a hardcoded rgba(0, 0, 0, 0.5) value. To maintain consistency with the design token migration, this should reference a semantic token (e.g., --td-backdrop-bg). If a specific token is missing from the global design tokens, consider defining one to ensure the backdrop can be themed appropriately.
|
|
||
| /* ── Error box ── */ | ||
| .sp-error-box { | ||
| border: 1px solid var(--td-color-error-light, var(--td-color-error)); |
There was a problem hiding this comment.
Using var(--td-color-error-light) for the border results in a very low-contrast (15% opacity) line that is difficult to see. For error and warning boxes, it is generally better to use the solid semantic color for the border to ensure the region is clearly delimited. This also applies to .sp-callout-error and .sp-callout-warning below.
border: 1px solid var(--td-color-error);
| .sp-callout-error { | ||
| border: 1px solid var(--td-color-error-light, var(--td-color-error)); | ||
| background: var(--td-color-error-light); | ||
| color: var(--td-color-error); | ||
| } |
| .sp-btn-primary:disabled { | ||
| background: var(--td-surface-bright); | ||
| color: var(--td-text-muted); | ||
| } |
There was a problem hiding this comment.
The combination of var(--td-surface-bright) background and var(--td-text-muted) text for disabled primary buttons results in a low contrast ratio (approx 2.5:1 in dark mode). While disabled states are exempt from standard WCAG contrast requirements, this may still be difficult to read. Consider using a slightly more distinct color pair for better accessibility.
Adversarial Review: StarterPackCatalogModal Design Token MigrationOverall AssessmentThe migration is thorough and well-structured. All hardcoded Tailwind color utilities ( 1. Hardcoded backdrop color (Low).sp-backdrop {
background: rgba(0, 0, 0, 0.5);
}This is the only remaining hardcoded color in the file. Every other color uses Suggestion: Consider 2.
|
| Finding | Severity | Action needed? |
|---|---|---|
Hardcoded backdrop rgba(0,0,0,0.5) |
Low | Optional tokenize |
| Info token = Primary token (no visual distinction) | Medium | Token design issue |
| Pack card hover border gets lighter | Low | Use stronger border token |
| Computed styles fully migrated | -- | None (good) |
| Dark/light mode coverage | -- | Good |
| Disabled primary button contrast | Medium | Fix for accessibility |
| Inconsistent disabled styling approach | Low | Standardize |
| Tab hover/active jump | Nit | Intentional check |
No blocking issues, but findings #3 (inverted hover border) and #6 (disabled button contrast) are worth addressing before merge.
Address review: .sp-pack-card:hover used --td-border-ghost which is lighter than the resting --td-border-default, making hover less visible.
Summary
bg-white,text-gray-*,border-gray-*,bg-blue-*,bg-red-*,bg-green-*,bg-amber-*, etc.) inStarterPackCatalogModal.vuewith scoped CSS classes that reference--td-*design tokens.<style scoped>block with semantic class names (sp-panel,sp-tab,sp-btn-primary,sp-tone-success,sp-callout-error, etc.) that map to design tokens fromdesign-tokens.css.data-theme.outcomeSummaryToneClass,conflictSeverityBadgeClass) now return semantic class names instead of Tailwind color utilities.Closes #612
Test plan
npm run typecheckpassesnpm run buildpasses (typecheck + vite build)