Using section-specific theme palettes for different application areas
You've now entered the Seasons section of the application, which has its own set of available themes:
In this example the user can't select themes (no picker in the navbar). Each component sets the Global Theme using the ThemeService
to set the theme, that will apply as long as that component is active.
These themes are completely different from the Material themes in the main section. This demonstrates how the SpiderBaby theming system can provide different theme contexts for different application areas.
When entering this section, we replace the available system themes using DynamicThemeConfigService
:
This technique is perfect for:
Each seasonal card below uses its own theme without affecting the rest of the application or being affected by the resto of the application:
Clicking "Go to [Season]" applies the theme to the entire section: Including the navbar and all other components.
Select from seasonal theme only available in this section:
sbApplyTheme
directive. @for (season of _seasonData(); track season.title) {
<sb-season-info-card [sbApplyTheme]="season.theme" [data]="season" />
}
This directive applies the theme only to the targeted element and its children, creating isolated theme contexts without affecting the rest of the application. Follow the link to see the global theming capabilities.