Component Theme Structure
Component themes are organized using a slot-based system that allows granular control over styling. Each component theme is defined inapp/assets/css/themes/components/.
Theme File Structure
Component themes use a standardized structure with slots, variants, and compound variants:Customizing Component Themes
- Via app.config.ts
- Direct Theme File
- Component Props
The recommended approach is to extend component themes through
app.config.ts. This allows you to override specific aspects while preserving defaults.Customizing Colors
Changing Semantic Colors
Update semantic color mappings inapp.config.ts:
Adding Custom Brand Colors
Define new brand colors inapp/assets/css/settings/colors.css:
nuxt.config.ts:
Available Components for Customization
The following components have theme files available for customization:button- Button component with multiple variantscard- Card container componentbadge- Badge and label componentmodal- Modal dialog componentinput- Input field componentdashboard-sidebar-collapse- Collapsible sidebar componentdashboard-panel- Dashboard panel componentnavigation-menu- Navigation menu component
Example: Button Variants
The button component supports multiple variants and colors:Compound Variants
Compound variants combine multiple variant properties:Customizing Icons
Configure icon mappings inapp.config.ts:
Best Practices
Use app.config.ts for Global Changes
Use app.config.ts for Global Changes
Always prefer
app.config.ts for project-wide theme customizations. This keeps your changes centralized and easier to maintain.Preserve Default Variants
Preserve Default Variants
When customizing component themes, spread the existing configuration to preserve defaults:
Use Semantic Colors
Use Semantic Colors
Reference semantic colors (primary, secondary, etc.) instead of brand colors in components. This makes theme switching easier.
Test Dark Mode
Test Dark Mode
Always test your customizations in both light and dark modes to ensure proper contrast and visibility.
Next Steps
App Config Reference
Detailed app.config.ts configuration options
Color System
Learn about the color system and brand palette