Theme System Overview
The application uses a combination of:- Per-game theme colors defined in
games.json - Tailwind CSS for utility classes and design tokens
- CSS custom properties for dynamic color injection
- Glass morphism effects for modern UI aesthetics
Game-Specific Themes
Each game insrc/data/games.json has a tema property that defines its primary accent color:
src/data/games.json
Where Theme Colors Appear
Thetema color is dynamically applied to:
Version Badge
The “Current: v6.4” badge in the top-right corner of game cards:
src/components/GameCard.astro:28-32
Hover Border Effect
The animated bottom border that appears on card hover:
src/components/GameCard.astro:49-50
The border transitions from 0 to full width on hover, creating a smooth fill effect.
Changing Game Colors
Choose Your Color
Select a hex color that matches your game’s brand identity. You can use tools like:
- Coolors for color palette generation
- Adobe Color for accessibility testing
- Browser DevTools eyedropper to sample from official artwork
Global Theme Configuration
Version Counter uses Tailwind CSS for global theming. The configuration is in the project root:tailwind.config.js
Built-in Color Classes
The application includes several pre-defined color utilities:| Class | Hex | Usage |
|---|---|---|
text-primary | #4ade80 | Primary green accent |
text-gold | #d4ad6a | Gold/yellow highlights |
bg-genshin | #4ade80 | Genshin Impact brand color |
text-slate-400 | - | Muted text |
border-slate-800 | - | Subtle borders |
Glass Morphism Effects
The application uses custom glass panel styles for modern UI elements:- Version badges on game cards
- Timer blocks on detail pages
- Interactive buttons and controls
Customizing Glass Effects
You can adjust the glass morphism intensity by modifying the alpha values:Counter Component Theming
TheCounter component (src/components/react/Counter.tsx) has two variants with different styling:
Mini Variant (Home Page)
src/components/react/Counter.tsx:66-73
- Compact 4-column grid
- Simple text-based display
- Uses
countdown-fontclass for numbers
Full Variant (Detail Pages)
src/components/react/Counter.tsx:78-85
- Large glass panel blocks
- Hover effects with color transitions
- Animated pulse on seconds
- Responsive sizing (aspect-square on mobile)
Customizing Timer Colors
The Full variant uses a purple accent color (#4b2bee) by default:
src/components/react/Counter.tsx:114-123
Option 1: Tailwind Config
Add a new color utility in Then use it in the component:
tailwind.config.js:Background Images and Overlays
Game cards use a gradient overlay system to ensure text readability:src/components/GameCard.astro:21-24
Gradient Breakdown
- Top (0%):
rgba(10, 10, 12, 0.2)— 20% opacity dark overlay - Bottom (100%):
rgba(10, 10, 12, 0.95)— 95% opacity dark overlay
Customizing Overlays
Dark Mode Support
The application is designed with dark mode as the primary theme. Tailwind’sdark: variant is used for conditional styling:
Responsive Design
Theme elements adapt to different screen sizes using Tailwind’s responsive prefixes:Animation and Transitions
The theme system includes several built-in animations:Pulse Animation
Hover Scale
Border Animation
Best Practices
Color Contrast
Color Contrast
- Ensure text has at least 4.5:1 contrast ratio against backgrounds
- Test theme colors with WCAG accessibility tools
- Avoid pure black (
#000000) — use near-black (#0a0a0c) instead - Provide sufficient contrast for interactive elements
Performance
Performance
- Use
backdrop-filtersparingly (GPU-intensive) - Optimize background images (compress, use modern formats like WebP)
- Limit the number of animated elements on screen
- Test on lower-end devices and mobile
Consistency
Consistency
- Use Tailwind utilities instead of custom CSS when possible
- Keep theme colors in sync with brand guidelines
- Document custom color choices for team reference
- Reuse glass-panel and other utility classes
Accessibility
Accessibility
- Don’t rely solely on color to convey information
- Provide text alternatives for visual indicators
- Test with screen readers and keyboard navigation
- Ensure animations respect
prefers-reduced-motion
Examples from Production
Here are the theme colors currently used in the application:src/data/games.json
Next Steps
Counter Component
Learn about the Counter component API
Layout Component
Explore the Layout component structure