Description
The README states one-off hex values are a "review-blocker" and that color should come from the design tokens in src/utils/tokens.ts and the :root custom properties in src/index.css. Two large surfaces violate this: src/components/RepayModal.tsx and src/pages/RequestEvaluation.tsx each define a local const COLOR = { bg: '#0d1117', surface: '#161b22', border: '#30363d', text: '#e6edf3', muted: '#8b949e', accent: '#58a6ff', success: '#3fb950', warning: '#d29922', danger: '#f85149' } block plus extensive inline style={{ ... }} usage. This issue removes those private palettes and routes both components through the shared token source.
Requirements and context
- Replace the local
COLOR objects in src/components/RepayModal.tsx and src/pages/RequestEvaluation.tsx with the canonical tokens from src/utils/tokens.ts (and/or the :root CSS variables in src/index.css).
- Where token names are missing, add them to
src/utils/tokens.ts rather than introducing new hex literals — the token catalogue is documented in docs/DESIGN_SYSTEM.md.
- Prefer moving heavy inline
style blocks into CSS that references the :root custom properties, consistent with how src/pages/CreditLines.tsx and src/pages/Dashboard.tsx already consume COLOR/UTIL_COLOR from tokens.
- Preserve the exact current visual appearance (same colors, same severity-to-color mapping for info/success/warning/danger).
- Non-functional: no raw
#rrggbb literals may remain in these two files after the change; keep strict TypeScript happy.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/tokenize-repay-and-evaluation.
2. Implement changes — delete the COLOR blocks, reference shared tokens, extract inline styles to CSS using :root variables; extend src/utils/tokens.ts as needed.
3. Write/extend tests — Vitest + @testing-library/react; assert token-backed styling hooks (class names or CSS variables) rather than literal hex.
4. Test and commit
npm install
npm test -- --run
npm run build
Example commit message
refactor(tokens): remove hardcoded hex from RepayModal and RequestEvaluation
Guidelines
- ≥90% coverage on any logic touched; visual parity is the primary bar.
- Maintain WCAG AA contrast — tokens must preserve the documented contrast ratios.
- Keep
docs/DESIGN_SYSTEM.md authoritative for the token list.
- Timeframe: 96 hours.
Description
The README states one-off hex values are a "review-blocker" and that color should come from the design tokens in
src/utils/tokens.tsand the:rootcustom properties insrc/index.css. Two large surfaces violate this:src/components/RepayModal.tsxandsrc/pages/RequestEvaluation.tsxeach define a localconst COLOR = { bg: '#0d1117', surface: '#161b22', border: '#30363d', text: '#e6edf3', muted: '#8b949e', accent: '#58a6ff', success: '#3fb950', warning: '#d29922', danger: '#f85149' }block plus extensive inlinestyle={{ ... }}usage. This issue removes those private palettes and routes both components through the shared token source.Requirements and context
COLORobjects insrc/components/RepayModal.tsxandsrc/pages/RequestEvaluation.tsxwith the canonical tokens fromsrc/utils/tokens.ts(and/or the:rootCSS variables insrc/index.css).src/utils/tokens.tsrather than introducing new hex literals — the token catalogue is documented indocs/DESIGN_SYSTEM.md.styleblocks into CSS that references the:rootcustom properties, consistent with howsrc/pages/CreditLines.tsxandsrc/pages/Dashboard.tsxalready consumeCOLOR/UTIL_COLORfrom tokens.#rrggbbliterals may remain in these two files after the change; keepstrictTypeScript happy.Acceptance criteria
RepayModal.tsxorRequestEvaluation.tsx.src/utils/tokens.tsand/orsrc/index.css:rootvariables.docs/DESIGN_SYSTEM.mdtoken catalogue is updated if tokens were added.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/tokenize-repay-and-evaluation.2. Implement changes — delete the
COLORblocks, reference shared tokens, extract inline styles to CSS using:rootvariables; extendsrc/utils/tokens.tsas needed.3. Write/extend tests — Vitest + @testing-library/react; assert token-backed styling hooks (class names or CSS variables) rather than literal hex.
4. Test and commit
npm install npm test -- --run npm run buildExample commit message
Guidelines
docs/DESIGN_SYSTEM.mdauthoritative for the token list.