Theming
Match the Embedded Portal to your brand with theme, colors, fonts, and custom CSS.
Theming
The Embedded Portal can be themed to match your application. You can configure the basics from the dashboard or override at runtime through the SDK.
Theme mode
Choose Light, Dark, or Auto from Settings → Embedded Portal.
Auto follows the user's system preference (prefers-color-scheme). You can also set the theme dynamically:
UserHero.setTheme('dark');Brand colors and tokens
The portal exposes a small set of CSS variables you can override either in the dashboard or at runtime via setCssVars:
| Variable | Purpose | Example |
|---|---|---|
primary | Primary action color (buttons, links) | #5b6cff |
background | Panel background | #ffffff |
foreground | Text color | #0f172a |
radius | Corner radius for inputs and cards | 12px |
fontFamily | Font stack used inside the portal | Inter, system-ui, sans-serif |
Set them at init time:
window.UserHeroQueue.push(['init', {
publicKey: 'YOUR_PUBLIC_KEY',
user: userPayload,
userHmac: userHmac,
cssVars: {
primary: '#5b6cff',
radius: '14px',
fontFamily: 'Inter, system-ui, sans-serif',
},
}]);Or update them later:
UserHero.setCssVars({ primary: '#10b981' });Values are sanitized — url(), expression(), semicolons, and other unsafe constructs are rejected.
Custom CSS (Pro Max)
On the Pro Max plan you can host a stylesheet at an HTTPS URL and point the portal at it via Custom CSS URL in settings. The portal loads it inside the iframe so you can fine-tune any class.
Restrictions:
- The URL must be HTTPS.
@import,expression(), andjavascript:URLs are stripped.- Use the documented class names below — internal class names may change between releases.
Stable class names
| Class | What it is |
|---|---|
.uh-shell | Outer container |
.uh-header | Top bar |
.uh-content | Scrollable body |
.uh-button | Primary buttons |
.uh-input, .uh-textarea | Form fields |
.uh-card | List items and ticket panels |
.uh-badge | Status pills |
.uh-tabs, .uh-tab | Tab strip |
.uh-metric | Metric cards |
.uh-comment | Reply bubbles |
.uh-footer | Footer area |
Removing the UserHero footer (Pro and Pro Max)
By default the portal shows a small "Powered by UserHero" footer. Pro and Pro Max workspaces can hide it from Settings → Embedded Portal → Show branding.