This document defines the color system for Crypto Data Aggregator. All components use the centralized design token system.
Migration Status: ✅ Complete (January 2026)
All data visualization components, loading states, coin pages, and core UI have been migrated to design tokens. 60+ components now use the semantic color system.
CoinConverter- Currency converter widgetCoinHeader- Coin detail page headerCoinInfo- Links and description sectionCoinNews- Related news articlesDeveloperStats- GitHub and community statsHistoricalTable- OHLCV data tableMarketStats- Market cap, volume, supplyMarketsTable- Exchange trading pairs
DigestPage- AI-powered daily digestSourcesPage- News sources browserTopicPage- Topic-filtered newsFeaturedArticle- Hero article componentReaderContent- Article reader view
A new premium component library is available at @/components/ui:
import {
Button, IconButton,
Card, CardHeader, CardContent, CardFooter, StatCard, FeatureCard,
Badge, PriceChangeBadge, RankBadge, StatusBadge, ChainBadge,
Input, SearchInput, NumberInput, Textarea,
Tooltip, Progress, CircularProgress,
Divider, Avatar, AvatarGroup, Skeleton
} from '@/components/ui';primary- Blue brand button with glowsecondary- Surface background with borderghost- Transparent with hover stateoutline- Primary border with transparent bgdanger- Red destructive actionsuccess- Green positive actionglass- Glassmorphism effect
default- Standard surface cardelevated- Raised with larger shadowglass- Glassmorphism effectgradient- Top gradient accent barinteractive- Click/tap feedbackoutline- Border only
New utility classes available in globals.css:
.glass-card- Premium glassmorphism.glass-modal- Frosted glass for modals.gradient-border- Animated gradient border.glow-primary/.glow-gain/.glow-loss- Glow effects.btn-glow/.btn-shine- Button effects.card-elevated/.card-gradient- Card styles.live-pulse- Live indicator animation.price-flash-up/.price-flash-down- Price change flash.badge-glow/.badge-gradient- Badge styles.table-premium- Enhanced table styling.input-premium/.search-premium- Form inputs.section-header- Section title with accent.divider-gradient/.divider-glow- Divider styles.number-mono/.number-display- Number formatting.progress-bar/.progress-bar-animated- Progress indicators
- CSS Variables -
src/app/globals.css(:rootblock) - TypeScript Tokens -
src/lib/colors.ts - Tailwind Config -
tailwind.config.js(references CSS vars)
| Old Pattern | New Pattern | Notes |
|---|---|---|
bg-black |
bg-background |
Main app background |
bg-white |
bg-surface |
Cards, modals (dark theme) |
dark:bg-black |
(remove) | Not needed, use semantic |
dark:bg-white |
(remove) | Not needed |
bg-gray-900 |
bg-background-secondary |
|
bg-gray-800 |
bg-surface |
|
bg-gray-700 |
bg-surface-hover |
|
bg-gray-100 |
bg-surface |
Light bg → surface |
bg-gray-50 |
bg-surface |
Light bg → surface |
bg-neutral-900 |
bg-background-secondary |
|
bg-neutral-800 |
bg-surface |
|
bg-slate-900 |
bg-background-secondary |
|
bg-slate-800 |
bg-surface |
| Old Pattern | New Pattern | Notes |
|---|---|---|
text-white |
text-text-primary |
Or keep for buttons |
text-gray-900 |
text-text-primary |
|
text-gray-700 |
text-text-secondary |
|
text-gray-600 |
text-text-secondary |
|
text-gray-500 |
text-text-muted |
|
text-gray-400 |
text-text-muted |
|
text-gray-300 |
text-text-secondary |
|
text-neutral-* |
Use text-text-* |
|
text-slate-* |
Use text-text-* |
| Old Pattern | New Pattern |
|---|---|
border-gray-700 |
border-surface-border |
border-gray-800 |
border-surface-border |
border-gray-200 |
border-surface-border |
border-gray-100 |
border-surface-border |
border-neutral-* |
border-surface-border |
border-slate-* |
border-surface-border |
| Old Pattern | New Pattern |
|---|---|
text-green-500 |
text-gain |
text-green-400 |
text-gain |
text-emerald-500 |
text-gain |
text-red-500 |
text-loss |
text-red-400 |
text-loss |
bg-green-* |
bg-gain-bg |
bg-red-* |
bg-loss-bg |
text-amber-* |
text-warning |
text-orange-* |
text-warning |
text-blue-500 |
text-primary |
| Old Pattern | New Pattern |
|---|---|
hover:bg-gray-100 |
hover:bg-surface-hover |
hover:bg-gray-700 |
hover:bg-surface-hover |
hover:bg-gray-800 |
hover:bg-surface-hover |
dark:hover:bg-black |
hover:bg-surface-hover |
Since we're always in dark mode, remove these patterns:
dark:bg-*→ Use the dark value directlydark:text-*→ Use the dark value directlydark:border-*→ Use the dark value directly
For libraries like Recharts that don't support CSS variables:
import { chartColors, colors } from '@/lib/colors';
// Use chartColors for Recharts
<Line stroke={chartColors.gain} />
<Bar fill={chartColors.loss} />
// Or individual colors
<Area stroke={colors.primary} />// Before
<div className="bg-white dark:bg-black rounded-xl border border-gray-200 dark:border-gray-700">
// After
<div className="bg-surface rounded-xl border border-surface-border">// Before
<button className="bg-blue-500 hover:bg-blue-600 text-white">
// After
<button className="bg-primary hover:bg-primary-hover text-white">// Before
<p className="text-gray-600 dark:text-gray-400">
<span className="text-gray-500 dark:text-gray-500">
// After
<p className="text-text-secondary">
<span className="text-text-muted">// Before
<span className={value > 0 ? 'text-green-500' : 'text-red-500'}>
// After
import { getPriceClass } from '@/lib/colors';
<span className={getPriceClass(value)}>
// Or
<span className={value > 0 ? 'text-gain' : 'text-loss'}>After migration, run:
npm run lint
npm run typecheck
npm run buildCheck for:
- No
bg-whiteorbg-blackpatterns (except overlays) - No
text-gray-*orbg-gray-*patterns - No
dark:prefixes (except for specific overrides) - All colors using design tokens
The following components have been fully migrated to use design tokens:
charts.tsx- UseschartColorsfrom colors.tscoin-charts/index.tsx- Price, volume, and mini chartsScreener.tsx- Filter panels and tableMarketStats.tsx- Market overview cardsSentimentDashboard.tsx- Gauges and sentiment cardsCorrelationMatrix.tsx- Correlation heatmapDominanceChart.tsx- Donut and bar chartsGasTracker.tsx- Gas price cardsLiquidationsFeed.tsx- Liquidation listPriceWidget.tsx- Compact price displayMarketMoodRing.tsx- Fear & Greed circular gauge (NEW)MarketMoodWidget.tsx- Complete sentiment widget (NEW)
- All 16
loading.tsxfiles in/src/app/ LoadingSpinner.tsxvariantsSkeletons.tsxcomponents
ErrorBoundary.tsxExportData.tsxKeyboardShortcuts.tsxPriceAlerts.tsxSocialBuzz.tsx
portfolio/AddHoldingModal.tsxportfolio/HoldingsTable.tsxportfolio/PortfolioSummary.tsxwatchlist/WatchlistMiniWidget.tsxwatchlist/WatchlistExport.tsx
useMarketMood.ts- Fear & Greed Index data fetching with helper functions (NEW)