Overview
TheuseBranding composable provides reactive access to application branding settings including brand name, logo, color theming, and login page customization. It automatically applies custom CSS variables and updates the document based on application settings.
Usage
Return Values
The composable returns an object with the following reactive properties:The custom brand name for the application. Returns the value from the
public.brand_name setting.The URL to the custom logo. Returns a formatted URL pointing to
/branding/logo endpoint if a logo is configured, otherwise null.The text to display in the login page footer. Returns the value from the
public.login_footer_text setting.The URL to link to from the login page footer. Returns the value from the
public.login_footer_url setting.Whether to show the footer on the login page. Returns
true unless explicitly set to "false" in the public.login_show_footer setting.Automatic Features
The composable automatically handles several application-wide updates:Theme Color Management
Automatically applies custom CSS variables for both light and dark color modes based on application settings. Supports customization of:- Core colors (background, foreground, primary, secondary, accent, muted, destructive, warning)
- Card and border colors
- Popover and input colors
- Sidebar colors
- Top navigation colors
- Border radius
Favicon Updates
Monitors thepublic.favicon_url setting and automatically updates the document favicon when changed.
Document Title
Automatically updates the document title to include the brand name:{brandName} | Counter-Strike Management System.
Color Mapping
The composable manages two color maps for theming:Light Mode Colors
Light Mode Colors
Maps application settings to CSS variables for light mode:
public.color_background→--backgroundpublic.color_foreground→--foregroundpublic.color_primary→--primary- And 30+ additional color mappings for comprehensive theming
Dark Mode Colors
Dark Mode Colors
Maps application settings to CSS variables for dark mode:
public.color_dark_background→--backgroundpublic.color_dark_foreground→--foregroundpublic.color_dark_primary→--primary- And 30+ additional dark mode color mappings
Dependencies
useApplicationSettingsStore()- Provides access to application settingsuseColorMode()- Provides current color mode (light/dark)useRuntimeConfig()- Provides runtime configuration for API domain
Example: Custom Branding
Notes
The composable uses Vue watchers with
immediate: true and deep: true options, so all automatic features are applied as soon as the composable is used and whenever settings change.