Overview
GitFolio templates support both light and dark themes, giving your portfolio a modern look that adapts to user preferences. Theme switching is powered bynext-themes and provides seamless transitions between modes.
Dark and light mode
All GitFolio templates include built-in support for light and dark themes:- How it works
- Implementation
GitFolio uses the The theme state is persisted in localStorage and applied on page load.
next-themes library to manage theme state:Template-specific themes
Some templates enforce a specific default theme:Dark-first templates
Templates like Persona and Pixel Perfect default to dark mode:Flexible themes
Other templates support both light and dark modes with adaptive styling:Theme configuration
Themes are configured in your app’s theme provider:System preference detection
GitFolio can automatically detect the user’s system theme preference:Theme toggle button
Add a theme toggle to your portfolio’s navigation:Theme toggle component
Theme toggle component
Template theme examples
Here’s how different templates implement theming:Pixel Perfect
GitHub-inspired design with:
- Dark mode by default
- Light borders and separators
- Contribution graph in theme colors
- Subtle gradients
Persona
Dark-themed template with:
- Black background (
#0a0a0a) - Stone-200 text color
- Animated gradient effects
- High contrast elements
White Space
Flexible theme with:
- Clean white/dark backgrounds
- Adaptive text colors
- Spacious layout
- Theme-aware shadows
Clean Slate
Minimalist theming:
- Neutral color palette
- Subtle theme transitions
- Focus on readability
- System theme support
Custom color schemes
While templates come with predefined themes, you can customize colors:Modifying theme colors
Advanced customization requires editing the template’s CSS variables or Tailwind configuration. This is recommended for users comfortable with CSS and Tailwind.
Per-template customization
Each template can have unique theme variables:Accessibility considerations
GitFolio themes are designed with accessibility in mind:Contrast ratios
All text maintains WCAG AA contrast ratios:
- Normal text: 4.5:1 minimum
- Large text: 3:1 minimum
- UI components: 3:1 minimum
Reduced motion
Respects user’s motion preferences:
Focus indicators
Clear focus states for keyboard navigation:
High contrast mode
Themes work with OS high contrast modes:
Theme persistence
Theme preferences are saved automatically:Troubleshooting themes
Theme not changing
Theme not changing
If the theme toggle doesn’t work:
- Ensure ThemeProvider wraps your app
- Check that
attribute="class"is set on ThemeProvider - Verify dark mode classes exist in your CSS
- Clear localStorage and refresh the page
Flash of unstyled content
Flash of unstyled content
To prevent theme flashing on page load:
Template ignores theme
Template ignores theme
Some templates enforce a specific theme:This is intentional for templates designed for a specific aesthetic.
Next steps
Choose a template
Explore templates with different theme aesthetics
Customize content
Personalize your portfolio content