Theme Structure
Themes in stevenson.space are defined using a comprehensive JSON structure:Getting Started with Themes
Theme customization in stevenson.space is currently controlled programmatically through the themes store. A UI for theme customization may be available in future releases.
localStorage.themeStyling and loaded on app initialization.
Customizing Colors
Base Colors
The most fundamental customization options:Background Colors
Background Colors
Control the main visual appearance:
Accent Color
Accent Color
The accent color affects buttons, icons, highlights, and interactive elements:Example accent colors:
- Light theme:
#1b5e20(green) - Sakura theme:
#f25477(pink) - Midnight theme:
#4fc3f7(cyan)
Text Colors
Text Colors
Override text colors for different hierarchy levels:Example:
Base Theme Selection
Start with a light or dark foundation:- Light Base
- Dark Base
The light base theme provides:
- Light background colors
- Dark text for readability
- Green accent (
#1b5e20)
Header Customization
The header is one of the most prominent visual elements:Adding Header Images
Choose Your Images
Prepare two versions of your header image:
- Full: For desktop/tablet (recommended: 1920x400px)
- Mobile: For phones (recommended: 800x300px)
Mobile image is optional - the full image will be used if not specified.
Example: Sakura Theme Header
The Sakura theme demonstrates a complete header setup:Particle Effects
Add dynamic, animated particles to your theme for visual interest:Configuring Particles
Particle Images
Particle Images
Provide an array of image paths. The system will randomly select from these:
Animation Parameters
Animation Parameters
Fine-tune the particle behavior:
Example: Sakura Theme Particles
The Sakura theme includes cherry blossom petals with subtle wind effect:Icon Card Colors
Customize the appearance of icon cards on the homepage:Complete Theme Examples
Applying Custom Themes
To apply theme customization programmatically:The
setStyling function accepts either a complete Theme object or just the ThemeStyling portion. It automatically saves to localStorage.themeStyling.Theme Persistence
Theme customizations are automatically persisted:Automatic Saving
When you call
setStyling(), the theme is immediately saved to localStorage.themeStyling.Initialization
On app startup,
initializeTheme() is called, which:- Checks for
localStorage.themeStyling - Parses and applies the saved theme
- Falls back to the default Light theme if parsing fails
Best Practices
Color Contrast
Ensure sufficient contrast between text and background colors for readability. Aim for WCAG AA compliance (4.5:1 ratio).
Performance
Limit particle counts and sizes to maintain smooth performance, especially on mobile devices.
Asset Paths
Always use the
assets:// protocol for images to ensure proper resolution by the app’s asset management system.Theme Consistency
Choose accent colors that complement your background and header images for a cohesive visual experience.
Technical Reference
For developers working with the theme system:See
src/stores/themes.ts and src/themes/*.json for complete theme implementations and examples.