Overview
Kuest provides a comprehensive theming system that allows you to customize colors, corner radius, and visual appearance. All theme settings are managed through the Admin Panel under Theme.Theme Presets
Kuest includes four built-in color presets:| Preset | Description | Use Case |
|---|---|---|
| Default | Standard color palette | General purpose |
| Midnight | Cool blue-purple tones | Discord-inspired dark theme |
| Lime | High-energy green accent | Bold, energetic branding |
| Amber | Warm amber palette | Binance-inspired warm theme |
- Admin Panel
- Code Implementation
- Navigate to Admin → Theme
- Select a preset from the Preset dropdown
- Click Save settings
- Preview with Preview Light and Preview Dark buttons
Color Tokens
Kuest uses a token-based color system with separate values for light and dark modes.Core Surface Tokens
| Token | Description |
|---|---|
background | Main background color |
foreground | Primary text color |
card | Card background color |
card-foreground | Card text color |
popover | Popover background |
popover-foreground | Popover text |
muted | Muted background |
muted-foreground | Muted text |
Brand and Accent Tokens
| Token | Description |
|---|---|
primary | Primary brand color |
primary-foreground | Text on primary |
secondary | Secondary brand color |
secondary-foreground | Text on secondary |
accent | Accent highlights |
accent-foreground | Text on accent |
Outcome and Alert Tokens
| Token | Description |
|---|---|
yes | ”Yes” outcome color |
yes-foreground | Text on yes |
no | ”No” outcome color |
no-foreground | Text on no |
destructive | Error/warning color |
destructive-foreground | Text on destructive |
Input and Border Tokens
| Token | Description |
|---|---|
border | Border color |
input | Input field border |
ring | Focus ring color |
Chart Tokens
| Token | Description |
|---|---|
chart-1 through chart-5 | Chart palette colors |
Custom Color Overrides
- Admin Panel
- Supported Formats
- JSON Override
- Navigate to Admin → Theme
- Scroll to Theme tokens section
- Customize individual tokens for light/dark modes
- Enter colors in supported formats
- Click Save settings
Use the color picker or enter values manually. The reset icon restores the preset default.
Corner Radius
Adjust the roundness of UI elements (buttons, cards, inputs).- Presets
- Custom Values
| Preset | Value | Description |
|---|---|---|
| Default | (empty) | Uses theme default |
| Sharp | 0 | No rounding |
| Soft | 0.5rem | Subtle rounding |
| Round | 1rem | Full rounding |
Theme Configuration Files
theme-settings.ts
Manages theme settings and database integration:src/lib/theme-settings.ts
theme.ts
Core theme logic and color token handling:src/lib/theme.ts
Settings Storage
Theme settings are stored in thesettings table:
| Group | Key | Description |
|---|---|---|
theme | preset | Theme preset ID |
theme | radius | Corner radius value |
theme | light_json | Light mode color overrides (JSON) |
theme | dark_json | Dark mode color overrides (JSON) |
Database Access
CSS Integration
The theme system generates CSS custom properties:Using Theme Variables
In your components, reference theme variables:Admin Theme Panel
The admin theme panel provides visual theme editing: Location: Admin → Theme Features:- Preset selector with descriptions
- Corner radius slider/input
- Live preview cards showing:
- Market cards
- Primary/secondary buttons
- Input fields
- Popovers
- Chart colors
- Separate light/dark mode token editors
- Color pickers with hex/OKLCH support
- JSON editor for advanced customization
- Reset buttons to restore defaults
Changes take effect immediately after saving. Users may need to refresh to see updates.
Best Practices
Color Selection
Color Selection
- Maintain sufficient contrast ratios (WCAG AA: 4.5:1 for text)
- Test colors in both light and dark modes
- Use OKLCH for perceptually uniform color scales
- Keep brand colors consistent across themes
Dark Mode
Dark Mode
- Don’t invert colors directly; adjust lightness
- Reduce saturation slightly in dark mode
- Ensure readability with proper contrast
- Test with actual dark backgrounds, not pure black
Accessibility
Accessibility
- Use semantic color tokens (primary, destructive, etc.)
- Don’t rely solely on color to convey meaning
- Test with color blindness simulators
- Ensure focus indicators are visible
Performance
Performance
- Minimize the number of custom overrides
- Use presets as a base when possible
- Test theme loading on slow connections
- Cache theme configuration appropriately
Troubleshooting
Colors not updating
Colors not updating
- Clear browser cache and hard refresh (Ctrl+Shift+R)
- Check if settings were saved successfully
- Verify color format is valid (hex or OKLCH)
- Ensure no CSS is overriding theme variables
Invalid color format error
Invalid color format error
- Only hex (#fff, #ffffff) and OKLCH are supported
- RGB/HSL must be converted to hex or OKLCH
- Remove any invalid characters or spaces
- Check JSON syntax if editing directly
Theme not persisting
Theme not persisting
- Check database connection
- Verify admin permissions
- Look for errors in server logs
- Ensure settings table has correct schema
Related Configuration
Branding
Customize logos, site name, and identity
Localization
Multi-language theme labels
Admin Panel
Access the theme configuration panel