The frontend now uses a comprehensive theme-aware color system based on shadcn/ui conventions. All hardcoded color values have been replaced with semantic CSS variables that automatically adapt to light and dark modes.
--primary: #1e9df1 /* Brand blue - primary actions */
--destructive: #f4212e /* Red - errors, destructive actions */
--success: #17bf63 /* Green - success states */
--warning: #f7b928 /* Yellow - warnings, pending states */
--info: #1e9df1 /* Blue - informational content */--primary: #1c9cf0 /* Brand blue - primary actions */
--destructive: #f4212e /* Red - errors, destructive actions */
--success: #00b87a /* Green - success states */
--warning: #f7b928 /* Yellow - warnings, pending states */
--info: #1c9cf0 /* Blue - informational content */Use for:
- Completed actions (finalized hackathons, submitted projects)
- Verified status (verified GitHub accounts)
- Success messages and confirmations
- Registered/staked status badges
- Checkmarks and success icons
- Refund available indicators
Tailwind Classes:
text-successbg-success,bg-success/20,bg-success/10border-success,border-success/30,border-success/50hover:bg-success/90
Use for:
- Pending states (staking required, awaiting action)
- Stake amounts and financial warnings
- Score not yet finalized
- Cautionary messages
- "Not verified" status
Tailwind Classes:
text-warningbg-warning,bg-warning/20,bg-warning/10border-warning,border-warning/30,border-warning/50hover:bg-warning/90
Use for:
- Informational badges (AI scores, project submitted)
- Data displays
- Neutral status indicators
- Submit project actions
- Fee settlement actions
Tailwind Classes:
text-infobg-info,bg-info/20,bg-info/10border-info,border-info/30,border-info/50hover:bg-info/90
Use for:
- Error messages and failed states
- Not registered/not staked badges
- Validation errors
- Destructive actions (delete, remove)
- Critical warnings
Tailwind Classes:
text-destructivebg-destructive,bg-destructive/20,bg-destructive/10border-destructive,border-destructive/30,border-destructive/50hover:bg-destructive/90
Use for:
- Primary call-to-action buttons
- Judge scoring actions
- Calculate final scores
- Active state indicators
- Brand-related elements
- Main navigation highlights
Tailwind Classes:
text-primarybg-primary,bg-primary/20,bg-primary/10border-primary,border-primary/30,border-primary/50hover:bg-primary/90
VerificationModal.tsx- 5 replacementsUserProfile.tsx- 4 replacementsProjectSubmissionForm.tsx- 6 replacementsfileupload.tsx- 3 replacementsWhyChooseKlu.tsx- 1 replacement
home/page.tsx- 2 replacementshome/[id]/page.tsx- 10 replacementsparticipants/[id]/page.tsx- 9 replacementssubmission/[hackathonId]/page.tsx- 3 replacementsmint-nft/[hackathonId]/page.tsx- 3 replacementsCreatehack/page.tsx- 2 replacements
<span className="text-green-400 bg-green-500/20 border-green-500/30">
Success!
</span>
<button className="bg-yellow-500 hover:bg-yellow-600 text-black">
Stake ETH
</button>
<div className="text-red-600 bg-red-100">
Error occurred
</div><span className="text-success bg-success/20 border-success/30">
Success!
</span>
<button className="bg-warning hover:bg-warning/90 text-warning-foreground">
Stake ETH
</button>
<div className="text-destructive bg-destructive/20">
Error occurred
</div>- Automatic Dark Mode: Colors adapt seamlessly between light and dark themes
- Consistency: Same semantic meaning = same color across the entire app
- Maintainability: Change theme colors in one place (
globals.css) - Accessibility: Semantic colors maintain proper contrast ratios
- Future-Proof: Easy to rebrand or customize themes
-
Use Semantic Names: Choose colors based on meaning, not appearance
- ✅
text-successfor completed actions - ❌
text-green-400(hardcoded)
- ✅
-
Preserve Opacity: Maintain opacity values for backgrounds
- ✅
bg-success/20for subtle backgrounds - ✅
bg-successfor solid backgrounds
- ✅
-
Consistent Hover States: Use
/90for hover darkening- ✅
hover:bg-success/90 - ❌ Custom darker shade
- ✅
-
Border Consistency: Match border colors with background intent
- ✅
bg-success/20 border-success/30 - ❌ Mixing different color families
- ✅
To add new semantic colors:
- Add to
:rootinglobals.css:
:root {
--custom-color: #hexvalue;
--custom-color-foreground: #hexvalue;
}- Add to
.darkinglobals.css:
.dark {
--custom-color: #hexvalue;
--custom-color-foreground: #hexvalue;
}- Add to
@theme inline:
@theme inline {
--color-custom-color: var(--custom-color);
--color-custom-color-foreground: var(--custom-color-foreground);
}- Add utility classes:
.text-custom-color {
color: var(--custom-color);
}
.bg-custom-color {
background-color: var(--custom-color);
}
.border-custom-color {
border-color: var(--custom-color);
}- All opacity modifiers (
/20,/10,/30, etc.) are automatically supported - Foreground colors are automatically calculated for proper contrast
- Chart colors remain separate for data visualization consistency
- Sidebar colors have their own variants for navigation