How Section-Based Theming Works

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.

SpringSummerAutumnWinter

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.

Hierarchical Theme Architecture

Hover over sections to see details
Root App
Base Angular Material Styles
Root Themes Defined Here
- Default
- Violet and Lime
- Pastel
- Deep Ocean
- Cherry Blossom
Main Section
Inherits Material Themes from Root
Seasons Section
Replaces with Seasonal Themes:
- Seasons Home
- Spring
- Summer
- Autumn
- Winter

How it works

When entering this section, we replace the available system themes using DynamicThemeConfigService:

This technique is perfect for:

  • Multi-tenant applications with different branding per tenant
  • Separate themed areas within a single application
  • Seasonal or time-based theme variations
  • Feature-specific theme contexts

Using Themes in Components

Local Theme Application

Each seasonal card below uses its own theme without affecting the rest of the application or being affected by the resto of the application:

Global Theme Application

Clicking "Go to [Season]" applies the theme to the entire section: Including the navbar and all other components.

Try Different Themes

Select from seasonal theme only available in this section:

Seasonal Theme Examples

Each card below demonstrates local theming (bounded by the card) using our 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.
SpringFresh and vibrant colors.
SummerWarm and bright palettes.
AutumnEarthy and cozy tones.
WinterCool and crisp aesthetics.