#Themes
Retype's theme
system allows you to customize the visual appearance of your website by overriding theme variables. With themes, you can adjust colors, spacing, typography, and other design elements to match your brand or personal preferences.
Pro Feature
The theme functionality requires a Retype Pro key or adding the following pro
trial mode setting into your project retype.yml
configuration file:
#Quick Start
The simplest way to customize your site's appearance is by adding a theme
configuration to your retype.yml
file and setting a custom base-color
value.
#Configuration Structure
The theme configuration supports two main sections:
#base
theme
The base
theme controls the light mode appearance and serves as the foundation for your project's visual style:
#dark
theme
The dark
theme specifically targets dark mode appearance. When the website is switched to dark mode, these overrides are applied:
#Examples
#Brand Color Customization
To match your brand colours:
#Typography Adjustments
To make your site more readable:
#Dark Mode Optimization
To create a custom dark theme:
#Component Styling
To customize specific components:
#Best Practices
#1. Start Small
Begin with basic colour changes before moving to complex customizations:
#2. Maintain Contrast
Ensure sufficient contrast between text and background colours for accessibility:
#3. Test Both Themes
Always test your customizations in both light and dark modes:
#4. Use Semantic Variables
Prefer semantic variables over direct colour values when possible:
#Troubleshooting
#Theme Not Applied
- Ensure you have a valid Retype Pro license or
start.pro: true
- Check that your YAML syntax is correct
- Verify variable names match exactly (case-sensitive)
#Dark Mode Issues
- Remember that dark theme variables only apply in dark mode
- Test with the theme switcher in your site
- Some variables may need both base and dark definitions
#Variable Names
- All variable names use kebab-case (hyphens, not underscores)
- Variables are case-sensitive
- Don't include the
--
prefix in your configuration