UI Themes
UI Themes control the visual appearance of GEM user interfaces. Each theme includes CSS styles, icons, background images, and optional zone maps for creating consistent, branded experiences across all UIs.
Overview
The UI Themes page provides complete theme management:
- CSS Editor: Customize styles and colors
- Background Management: Upload and map background images
- Icon Library: Manage icon sets
- Zone Maps: Create interactive floor plans
- Theme Assignment: Apply themes to specific UIs
- Preview: Test themes before deployment
Theme Selector
Top toolbar provides theme selection and management:
Theme Selector
- Dropdown of all themes
- Select to edit
- Shows theme name
Actions:
- Copy - Duplicate existing theme
- New - Create blank theme
- Export - Export theme files to filesystem
UI Selector
- Choose UI to apply theme to
- Shows current theme for each UI
Set Button
- Apply selected theme to selected UI
- Saves theme attribute for UI
Preview Button
- Open theme in live preview window
- Test in real environment
Theme Tabs
Themes have four tabs for different asset types:
1. Styles Tab
CSS editor for theme styling:
Features:
- Syntax-highlighted CSS editor
- Edit theme's
style.cssfile - Auto-complete (basic)
- Search and replace (
Ctrl+F/Ctrl+H) - Code formatting (
Ctrl+Shift+B) - Status bar showing cursor position (line, column)
- Unsaved changes warning when navigating away
- Save button to apply changes
CSS Variables:
Themes should define CSS variables for consistency:
:root {
/* Colors */
--primary-color: #277ad4;
--secondary-color: #1e5ba8;
--background-color: #ffffff;
--surface-color: #f9f9f9;
--text-primary: #1f2937;
--text-secondary: #6b7280;
--border-color: #e5e7eb;
/* Spacing */
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 16px;
--spacing-lg: 24px;
/* Typography */
--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto;
--font-size-base: 16px;
--font-size-lg: 18px;
--font-size-xl: 24px;
/* Layout */
--border-radius: 8px;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
Component Styles:
Style GEM components:
/* Zone Cards */
.zone-card {
background: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: var(--spacing-md);
}
.zone-card.on {
background: var(--primary-color);
color: white;
}
/* Buttons */
.btn-primary {
background: var(--primary-color);
color: white;
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--border-radius);
}
/* Navigation */
.nav-control {
font-size: var(--font-size-base);
padding: var(--spacing-sm);
}
Saving:
- Click Save button after editing
- Changes apply immediately to preview window (if open)
- UIs reload automatically (if configured)
2. Backgrounds Tab
Manage background images for pages and routes:
Background Selector
- Dropdown of uploaded background images
- Preview changes background display
Route Selector
- Dropdown of all routes/pages
- Special route
*= default background for all pages
Mapping Actions:
- Set - Map selected background to selected route
- Unset - Remove background mapping for route
Upload:
- File input to select image files
- Upload button to upload to theme
Preview:
- Large preview area shows selected background
- Scaled to fit display area
Background Mapping
Assign different backgrounds to different pages:
Example Configuration:
Route: * (default)
Background: neutral_texture.png
Route: /controls/lighting
Background: lighting_ambient.jpg
Route: /av
Background: theater_room.jpg
Route: /dashboard
Background: dashboard_bg.png
Result: Each page shows its configured background, or default if not mapped.
Uploading Backgrounds
- Click file input
- Select PNG or JPG file
- Click Upload
- Background added to theme
- Appears in background selector
Image Requirements:
- Format: PNG or JPG
- Recommended Size: 1920x1080 or higher for large displays
- File Size: < 5MB for performance
- Aspect Ratio: Match target screen (16:9, 4:3, etc.)
3. Icons Tab
Manage theme icon library:
Upload Icons:
- File input supports multiple files
- Click Upload Icons to upload
- Icons added to theme's
/icons/directory
Icon Grid:
- Visual display of all icons
- Checkbox for batch selection
- Icon filename shown below each icon
Delete Selected:
- Select icons with checkboxes
- Click Delete Selected
- Confirm deletion
- Icons removed from theme
Icon Count:
- Display shows total icon count
- Helps track theme assets
Icon Requirements
- Format: PNG or SVG
- Size: 64x64 to 128x128 pixels recommended
- Style: Should match theme aesthetic (flat, skeuomorphic, etc.)
- Naming: Descriptive lowercase names (e.g.,
power.png,volume.svg) - Transparency: Use transparent backgrounds for flexibility
Standard Icons
Include these icons for full GEM compatibility:
Control Icons:
lighting,audio,video,shades,climate,securitycamera,pool,irrigation,lock,gate
Action Icons:
power,power_on,power_off,volume,muteup,down,left,right,select,back,homeplay,pause,stop,next,previous
State Icons:
on,off,open,closed,locked,unlockedonline,offline,warning,error,success
Misc Icons:
settings,user,notification,calendar,weather
4. Zone Maps Tab
Create interactive floor plans and zone maps:
The Zone Maps tab provides a visual interface for placing zones on floor plan images:
Left Sidebar - Controls
Map Configuration:
- Subsystem - Select subsystem (lighting, shades, etc.)
- UI - Select a specific UI to scope the map to (optional)
- Map - Select floor plan image
- Delete Current Map - Remove map and all zone positions
Zone Management:
- Zone Group - Select which zone group to add
- Add Zones to Map - Place all group zones on map
- Remove Selected Zones - Delete selected zones from map
Map Upload:
- File input to select floor plan image
- Upload Map Image - Upload to theme
Status:
- Shows current map name
- Shows count of zones on map
Right Side - Map Display
Interactive floor plan editor:
Features:
- Drag Zones: Click and drag zone icons to position
- Multi-Select: Shift+click to select multiple zones
- Delete: Select zones and use Remove button
- Zoom: Zoom in/out on map (if implemented)
- Live Updates: Changes save automatically
Using Zone Maps
1. Upload Floor Plan
-
Create or obtain floor plan image:
- Photo of actual floor
- Architectural drawing
- Simplified room layout
- Recommended: PNG with transparency
-
Click file input in "Upload New Map" section
-
Select floor plan image
-
Click Upload Map Image
-
Map added to theme
2. Select Map and Subsystem
- Select Subsystem (e.g., Lighting)
- Select Map (e.g., first_floor.png)
- Map displays in right panel
- Select UI if working with specific UI
3. Add Zones to Map
- Select Zone Group (e.g., "First Floor Lights")
- Click Add Zones to Map
- Confirm adding zones
- All zones from group added at center of map (x:50%, y:50%)
4. Position Zones
- Click and drag each zone icon to actual position
- Icons represent zone locations on floor plan
- Positions save automatically as you drag
5. Remove Zones (Optional)
- Click zones to select (shift-click for multiple)
- Click Remove Selected Zones
- Confirm removal
- Zone icons removed from map
Zone Map Display
Map data is stored as zone attributes:
{
"map": "first_floor.png",
"x": 25.5,
"y": 42.3
}
Attribute: map_coordinate on each zone
Components: ZoneMap component renders maps in UIs
Theme Assignment
Assigning Theme to UI
- Select theme from dropdown
- Select UI from UI selector
- Click Set button
- Theme attribute set for UI:
theme = "theme_name" - UI immediately uses new theme (on next load)
Global vs. UI-Specific Themes
Global Theme:
- Set on UI with ID 0
- Default for all UIs
- Fallback when UI has no theme
UI-Specific Themes:
- Set on specific UI IDs
- Overrides global theme
- Allows per-location branding
Example:
Global (UI 0): professional_theme
Kitchen Panel (UI 2): bright_theme
Master Bedroom (UI 5): dark_theme
Result:
- Kitchen shows bright theme
- Master bedroom shows dark theme
- All other UIs show professional theme
Theme Preview
Click Preview button to test theme:
Preview Window
Opens new browser window with:
- Selected UI loaded
- Selected theme applied
- Live, functional interface
Use Preview For:
- Testing color changes
- Verifying icon compatibility
- Checking background images
- Ensuring readability
- Client demonstrations
After Preview:
- Close preview window when done
- Returns to theme editor
Creating a New Theme
To create a theme from scratch:
- Click New button
- Enter theme name (e.g.,
custom_dark) - Theme created with minimal starter CSS
- Edit CSS in Styles tab
- Upload icons, backgrounds, maps
- Assign to UI and test
Copying a Theme
To create a variation of an existing theme:
- Select source theme
- Click Copy button
- Enter new theme name (e.g.,
carbon_blue) - Complete theme duplicated:
- All CSS copied
- All icons copied
- All backgrounds copied
- All maps copied
- Edit as needed
Use Cases:
- Client-specific branding
- Seasonal variations
- Dark/light mode versions
- Testing major changes without affecting original
Exporting Themes
Click Export to write theme to filesystem:
Result:
- Theme files written to
static/themes/{theme_name}/ - Includes:
style.css/icons/directory/backgrounds/directory/maps/directory
Use Cases:
- Version control
- Backup before changes
- Sharing themes
- External editing
Built-In Themes
GEM includes several professional themes:
prodigy
- Default modern theme
- Glassmorphic surfaces with translucency
- Cinematic background imagery
- Best for residential touchpanels and large displays
appeal
- iOS-style dark theme
- System materials, vibrancy, SF-style typography
- Pill-and-card components with subtle shadows
- Best for mobile clients and minimalist installations
carbon
- Modern dark theme
- Blue accent colors
- High contrast
- Professional aesthetic
flat
- Solid panels and high-contrast typography
- Minimal effects — fastest rendering on low-power displays
legacy
- Classic GEM look retained for upgrades
- Useful when refreshing UI is out of scope
Customize: Copy built-in theme and modify rather than editing directly.
:::note Shipped assets are auto-imported
Theme files shipped with a release (e.g. new icons under static/themes/{name}/icons/) are backfilled into the database the first time GEM boots on the new version — so they behave like any other tracked asset (carried across copies, included in exports, served from disk after the next theme export). Existing rows are never overwritten, so user customizations are preserved.
:::
Theme Development
CSS Architecture
Recommended Structure:
/* 1. CSS Variables */
:root {
--primary-color: ...;
}
/* 2. Base Styles */
body, html {
font-family: ...;
}
/* 3. Layout */
.container, .grid {
...
}
/* 4. Components */
.zone-card, .btn, .nav {
...
}
/* 5. States */
.on, .off, .active {
...
}
/* 6. Responsive */
@media (max-width: 768px) {
...
}
Responsive Design
Support multiple screen sizes:
/* Desktop */
.zone-grid {
grid-template-columns: repeat(4, 1fr);
}
/* Tablet */
@media (max-width: 1024px) {
.zone-grid {
grid-template-columns: repeat(3, 1fr);
}
}
/* Mobile */
@media (max-width: 768px) {
.zone-grid {
grid-template-columns: repeat(2, 1fr);
}
}
Dark Mode Themes
Considerations for dark themes:
:root {
--background-color: #1a1a1a;
--surface-color: #2a2a2a;
--text-primary: #e5e5e5;
--text-secondary: #a0a0a0;
/* Reduce contrast for readability */
--border-color: #444444;
/* Muted accent colors */
--primary-color: #4a90e2;
}
Dark Mode Best Practices:
- Reduce pure white (#fff) to off-white (#e5e5e5)
- Increase border subtlety
- Use muted accent colors
- Test readability extensively
- Consider eye strain for long viewing
Zone Maps
Interactive floor plans enhance user experience:
Map Creation Workflow
1. Create/Obtain Floor Plan
Options:
- Take photo of floor
- Scan architectural drawing
- Create in design software (Illustrator, Figma)
- Use online floor plan tools
Tips:
- Remove clutter from photos
- Increase contrast for clarity
- Simplify details (focus on room outlines)
- Use consistent scale
2. Prepare Image
- Format: PNG (supports transparency)
- Size: 1920x1080 or proportional
- Resolution: 72-150 DPI
- File size: < 2MB
3. Upload to Theme
- Select theme
- Go to Zone Maps tab
- In "Upload New Map" section:
- Click file input
- Select floor plan image
- Click Upload Map Image
- Map appears in map selector
4. Add Zones to Map
- Select Subsystem (e.g., Lighting)
- Select UI (if UI-specific)
- Select Map (uploaded floor plan)
- Select Zone Group
- Click Add Zones to Map
- Confirm adding zones
- All zones from group appear on map at center
5. Position Zones
- Click and drag each zone icon to its physical location
- Icons represent zone positions:
- Light: Place at light fixture location
- Shade: Place at window location
- Thermostat: Place at thermostat location
- Positions save automatically
6. Deploy Map
Maps can be used in:
- Custom widgets (ZoneMap component)
- Dashboard pages
- Wall panels with touch screens
- Interactive UIs
Map Display Options
Icon Styles:
- Use theme icons for zone icons
- Different icons per zone type
- State-based icons (on/off, open/closed)
Interactivity:
- Click zone icon to toggle/control
- Drag to reposition (admin mode)
- Hover for zone details
- Color-coded by state
Overlays:
- Zone names/labels
- Current state (on/off, position, temperature)
- Real-time updates via subscriptions
Multiple Maps
Create multiple maps for complex buildings:
Example:
first_floor.png
second_floor.png
basement.png
exterior.png
garage.png
Assign zones to appropriate maps:
- First floor zones → first_floor.png
- Second floor zones → second_floor.png
- Etc.
UIs can switch between maps using map selector widget.
Best Practices
Theme Design
-
Consistency: Use CSS variables for all colors, spacing, fonts
-
Contrast: Ensure sufficient contrast for readability
- WCAG AA minimum: 4.5:1 for normal text
- WCAG AAA preferred: 7:1 for normal text
-
Touch Targets: Buttons and controls at least 44x44px
-
Responsive: Test on multiple screen sizes
-
Performance: Optimize CSS, avoid expensive selectors
-
Fallbacks: Provide fallback fonts, colors
-
Documentation: Comment complex CSS
Icon Design
-
Consistency: All icons should have similar style
-
Size: Design at 128x128, export at multiple sizes
-
Simplicity: Keep designs simple for small display sizes
-
Transparency: Use transparent backgrounds
-
Testing: Test icons on dark and light backgrounds
Background Images
-
Resolution: High enough for largest display
-
File Size: Compress images for fast loading
-
Relevance: Choose backgrounds that don't distract from content
-
Contrast: Ensure content remains readable over background
-
Variety: Different backgrounds for different page types
Zone Maps
-
Clarity: Ensure floor plans are clear and easy to understand
-
Scale: Maintain consistent scale across multiple floor maps
-
Orientation: Orient maps consistently (north up, entrance at bottom, etc.)
-
Simplification: Remove unnecessary details from floor plans
-
Labels: Consider adding room labels to floor plan image
-
Updates: Update maps when physical layout changes
Advanced Topics
Theme Versioning
Maintain theme versions:
- Copy theme before major changes
- Name with version:
carbon_v1,carbon_v2 - Test new version thoroughly
- Switch UIs to new version when ready
- Keep old version as fallback
Multi-Brand Themes
For service providers managing multiple clients:
- Create base theme with common structure
- Copy for each client
- Customize colors, logos, backgrounds
- Assign client-specific themes to their UIs
- Maintain base theme for updates
Theme Inheritance
While not directly supported, simulate with:
- Create base theme with core styles
- Copy for variations
- Only modify differences in copies
- Maintain consistent variable names
Dynamic Theming
CSS can respond to attributes:
/* Controlled by attribute: ui.color_scheme */
.zone-card[data-scheme="warm"] {
--primary-color: #ff6b35;
}
.zone-card[data-scheme="cool"] {
--primary-color: #4a90e2;
}
Set via JavaScript in theme or widgets.
Animations and Transitions
Enhance user experience:
.zone-card {
transition: all 0.3s ease;
}
.zone-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.zone-card.on {
animation: pulse 0.5s ease;
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}
Use Sparingly: Too much animation can be distracting.
Troubleshooting
Theme Not Applying
Check:
- Theme Assignment: UI has theme attribute set
- Browser Cache: Clear cache and hard reload (Ctrl+F5)
- CSS Errors: Check browser console for CSS errors
- File Path: Verify
style.cssexists in theme directory
Icons Not Displaying
Check:
- Theme Assignment: UI using correct theme
- Icon Exists: Icon file exists in theme's
/icons/directory - Icon Name: Reference matches filename (without extension)
- File Format: PNG or SVG
- Cache: Clear browser cache
Background Not Showing
Check:
- Mapping: Background mapped to route in Backgrounds tab
- Route Match: Current page route matches mapping
- File Exists: Background file uploaded successfully
- Image Format: PNG or JPG
- File Size: Not too large (< 5MB)
Zone Map Not Loading
Check:
- Map Uploaded: Map image exists in theme
- Zones Positioned: Zones have map_coordinate attributes
- Subsystem Match: Viewing correct subsystem
- Component: ZoneMap component included on page
- Console Errors: Check browser console for errors
CSS Changes Not Reflecting
Try:
- Click Save button in Styles tab
- Hard refresh browser (Ctrl+F5 or Cmd+Shift+R)
- Close and reopen preview window
- Verify no CSS syntax errors
- Check browser developer tools for applied styles
Related Documentation
- UIs - Assigning themes to UIs
- UI Pages - Using themes on pages
- UI Widgets - Widget styling
- Gallery - Background image sources