This admin application includes a comprehensive theming system that allows you to customize the appearance for different clients. The system supports:
- Pre-built themes (Default, Blue Corporate, Dark Mode, Green Nature)
- Custom CSS variables for easy color customization
- Client-specific configurations for white-label deployments
- Logo customization (text or image-based)
- Real-time theme switching with browser persistence
static/
├── css/
│ ├── themes/
│ │ ├── default.css # Default theme
│ │ ├── blue.css # Blue corporate theme
│ │ ├── dark.css # Dark mode theme
│ │ └── green.css # Green nature theme
│ └── clients/
│ ├── client1-custom.css # Client 1 custom styles
│ └── client2-custom.css # Client 2 custom styles
├── config/
│ └── themes.json # Theme configuration
└── images/
└── logos/ # Client logo images
The easiest way to customize for a client is to:
- Choose one of the pre-built themes
- Navigate to
/theme-settingsin the admin panel - Select the desired theme
- Customize the logo text
- Save the configuration
For more advanced customization, create a new CSS file in the clients/ directory:
/* Client-specific custom styles */
:root {
--theme-primary: #your-brand-color;
--theme-secondary: #your-secondary-color;
--theme-header-bg: #your-header-color;
--theme-sidebar-active: #your-active-color;
--theme-logo-text: 'Your Client Name';
}
/* Additional custom styles */
.custom-element {
background-color: var(--theme-primary);
}// Set custom text logo
window.ThemeManager.setCustomLogo(null, 'Your Client Name');// Set custom image logo
window.ThemeManager.setCustomLogo('/images/logos/client-logo.png');The themes.json file contains all theme configurations:
{
"themes": {
"custom-client": {
"name": "custom-client",
"display_name": "Custom Client Theme",
"description": "Custom theme for specific client",
"colors": {
"primary": "#your-color",
"header_bg": "#your-header"
},
"logo": {
"text": "Client Name",
"image_url": "/images/logos/client-logo.png"
},
"css_file": "/css/clients/client-custom.css"
}
}
}--theme-primary: Main brand color--theme-secondary: Secondary color--theme-success: Success state color--theme-danger: Error/danger color--theme-warning: Warning color--theme-info: Information color--theme-header-bg: Header background--theme-sidebar-bg: Sidebar background--theme-sidebar-active: Active sidebar item
--theme-font-family: Main font family--theme-heading-font: Heading font family--theme-logo-font: Logo font family--theme-font-size-base: Base font size
--theme-sidebar-width: Sidebar width--theme-header-height: Header height--theme-border-radius: Border radius for elements
// Apply a theme
window.ThemeManager.applyTheme('blue');
// Set custom logo
window.ThemeManager.setCustomLogo(imageUrl, textFallback);
// Get current theme
const currentTheme = window.ThemeManager.getCurrentTheme();
// Get available themes
const themes = window.ThemeManager.getAvailableThemes();// Listen for theme changes
window.addEventListener('themeChanged', function(event) {
console.log('Theme changed to:', event.detail.theme);
console.log('Theme config:', event.detail.config);
});- Set environment variables for client configuration
- Load appropriate theme on application startup
- Apply client-specific CSS and logo
- Use subdomain or path to identify client
- Load client configuration based on URL
- Apply appropriate theme automatically
- Store client configurations in database
- Load theme based on user's client association
- Dynamic theme loading per user session
:root {
--theme-primary: #1e3a8a;
--theme-header-bg: #1e3a8a;
--theme-logo-text: 'Corporate Solutions';
}:root {
--theme-primary: #059669;
--theme-secondary: #10b981;
--theme-header-bg: #047857;
--theme-logo-text: 'HealthCare Pro';
}:root {
--theme-primary: #7c3aed;
--theme-secondary: #a855f7;
--theme-header-bg: #6d28d9;
--theme-logo-text: 'TechStart';
}The theming system uses modern CSS features:
- CSS Custom Properties (CSS Variables)
color-mix()function for hover states- CSS Grid and Flexbox for layouts
Supported browsers:
- Chrome 49+
- Firefox 31+
- Safari 9.1+
- Edge 16+
- Themes are loaded via separate CSS files to avoid blocking
- Theme changes are cached in localStorage
- CSS variables provide efficient runtime theme switching
- Minimal JavaScript overhead for theme management
- Check if CSS file exists and is accessible
- Verify CSS variable names are correct
- Clear browser cache and localStorage
- Check browser console for errors
- Verify image URL is accessible
- Check image file format (PNG, JPG, SVG supported)
- Ensure proper file permissions
- Test with text logo as fallback
- Use
!importantfor overriding default styles - Check CSS specificity
- Verify variable names match exactly
- Use browser dev tools to debug styles