GhaylStackDocumentationv1.0.2
العربيةWebsite
Web and mobile

Web and mobile

Tenant branding and appearance

Configure tenant palettes, logos and icons, understand asset restrictions and verify isolation between workspaces.

Choose the right appearance setting

Dashboard separates personal appearance from the visual identity shared by a tenant. Open /settings/branding to change tenant colors and assets; use the appearance settings for an individual user's theme preference. A tenant is the workspace boundary described in Tenants. Its branding does not define a separate identity for each department in Organizations.

The editor requires both Permissions.Tenants.ViewTheme and Permissions.Tenants.UpdateTheme, after the signed-in user's permissions have loaded. A user with viewing permission can receive the tenant theme without permission to edit it.

Edit colors and assets

The screen provides separate light and dark palettes, a preview and three asset slots: normal logo, dark logo and favicon. The nine palette fields are primary, secondary, tertiary, background, surface, error, warning, success and info. Colors accept six or eight hexadecimal digits, such as #147D92; a three-digit shorthand is invalid.

Choose files or supported asset URLs, inspect both previews, then save. Selected files are encoded as the existing upload contract inside brandAssets; saving is disabled while a mutation is pending or a value is invalid. The DTO also contains typography and layout fields, but the current Dashboard editor exposes palettes and assets only. Preserve the remaining DTO fields when writing a custom client.

Understand the request and rendering flow

Action Current-tenant API Required permission
Load GET /api/v1/tenants/theme Permissions.Tenants.ViewTheme
Save PUT /api/v1/tenants/theme Permissions.Tenants.UpdateTheme
Restore defaults POST /api/v1/tenants/theme/reset Permissions.Tenants.UpdateTheme

Dashboard does not send a target tenant override for these calls. The server resolves the current tenant. Successful save and reset operations invalidate the theme query and clear the editor's local draft.

useTenantBranding applies changed palette values to semantic CSS tokens. A logo-only change leaves the default colors intact. The dark theme uses the dark logo when present and otherwise falls back to the normal logo. The hook installs a tenant favicon and restores the original favicon when its effect is cleaned up.

Allow trusted asset origins

The browser's safeBrandAsset helper accepts the application origin, the API origin and additional origins in the deployment's /config.json:

json
{
  "brandingAssetOrigins": ["https://assets.example.com"]
}

Use the exact trusted origin; this example is a deployment placeholder. The helper rejects credentials in URLs, protocol-relative URLs, whitespace and arbitrary origins. HTTPS is required except for its explicit local or same-origin HTTP allowances. If an uploaded asset lives on another storage origin, review this setting alongside Configuration. A URL stored by the API can still be rejected by the browser's stricter display checks.

Verify changes and investigate failures

Save a distinctive primary color, switch between light and dark, reload and check the logo and favicon. Reset the theme and verify the defaults return. Then change to a second tenant and confirm its own identity appears. The theme query includes tenant, user and impersonating actor, and the editor is remounted when that identity changes.

For an absent editor, inspect hydrated permissions. For a failed save, inspect the API's validation response and all DTO fields. For a missing logo, inspect its resolved URL, trusted origin and network response; the sidebar falls back to the application mark when image loading fails. For stale colors, inspect the theme response and query invalidation before editing global CSS. These checks are a verification procedure, not a claim that your deployment has passed it.

Implementation references

View MarkdownBack to top

Search documentation

Use ↑ ↓ to move, Enter to open and Esc to close.