Overview
The theming system is built on Material Design 3 (M3) principles, using a custom color palette generated from a primary brand color. It supports:- Three color schemes: Automatic, Light, and Dark
- Dynamic theme switching without page reload
- CSS custom properties for easy customization
- RTL-aware layouts and styling
Color Palette
The color palette was generated using Angular Material’s M3 theme generator from the primary color#6e4b3a (a warm brown). See _theme-colors.scss:7:
The palette includes primary, secondary, tertiary, neutral, and error colors, each with tonal variants from 0 (black) to 100 (white).
Palette Structure
Two main palette variables are exported:Theme Configuration
The theme is applied insrc/styles.scss:13:
Theme Properties
Color configuration including primary and tertiary palettes
- theme-type:
color-schemeenables automatic light/dark switching
Font configuration
- brand-family: Bricolage Grotesque (for headings)
- plain-family: Noto Sans (for body text)
- Font weights: 400 (regular), 500 (medium), 700 (bold)
Component density (0 = comfortable, -1 = compact, -2 = very compact)
Color Scheme Options
Three color schemes are available (src/app/constants/color-scheme-options.constant.ts:4):Color Scheme Behavior
- Automatic
- Light
- Dark
Follows system preference using
prefers-color-scheme media query. Automatically switches between light and dark as the system preference changes.Dynamic Theme Switching
The theme is controlled via a CSS class on the<body> element:
Material Component Overrides
Jet customizes Material components for a refined appearance:Card Overrides
Sidenav Overrides
Tabs Overrides
List Overrides
Expansion Panel Overrides
Chips Overrides
Material Design Tokens
Jet uses M3 design tokens (CSS custom properties) for consistency:Surface Colors
--mat-sys-surface- Base surface color--mat-sys-surface-container-low- Slightly elevated surface--mat-sys-surface-container- Elevated surface--mat-sys-surface-container-highest- Highest elevation
On-Surface Colors
--mat-sys-on-surface- Text on surfaces--mat-sys-on-surface-variant- Secondary text--mat-sys-on-primary- Text on primary color
Shape
--mat-sys-corner-small- Small component border radius--mat-sys-corner-medium- Medium component border radius--mat-sys-corner-large- Large component border radius--mat-sys-corner-none- No border radius
Typography
--mat-sys-body-small- Small body text--mat-sys-body-medium- Medium body text--mat-sys-body-large- Large body text
Typography System
Three font families are configured:- Bricolage Grotesque: Brand typography for headings and emphasis
- Noto Sans: Plain text for body content (English)
- Noto Sans Arabic: Arabic language support with proper RTL rendering
Dynamic Font Switching
When Arabic is selected, the font family changes:Custom Styling
Using Design Tokens
Always use design tokens instead of hardcoded colors:Component-Specific Overrides
Override Material components within specific contexts:Responsive Layout
The theme includes responsive considerations:Safe Area Insets
Mobile device notches and home indicators are handled:Customizing the Theme
Change Primary Color
-
Run Angular Material’s theme generator:
-
Enter your desired primary color (e.g.,
#3f51b5) -
The generator updates
_theme-colors.scsswith new palettes
Add Custom Color Scheme
Add a new option toCOLOR_SCHEME_OPTIONS:
Best Practices
Always use design tokens
Always use design tokens
Use CSS custom properties like
var(--mat-sys-surface) instead of hardcoded color values for automatic theme support.Test all color schemes
Test all color schemes
Verify your UI works in light, dark, and automatic modes.
Maintain contrast ratios
Maintain contrast ratios
Ensure text meets WCAG AA standards (4.5:1 for normal text, 3:1 for large text).
Use semantic color names
Use semantic color names
Prefer
--mat-sys-on-surface over specific color values for better maintainability.Leverage Material overrides
Leverage Material overrides
Use
@include mat.component-overrides() to customize Material components consistently.Accessibility
The theming system prioritizes accessibility:- Sufficient contrast: M3 palettes ensure proper contrast ratios
- System preference: Automatic mode respects user’s OS theme
- Focus indicators: Material components include visible focus states
- Color independence: Information isn’t conveyed by color alone
Next Steps
Internationalization
Multi-language support with RTL
PWA Features
Progressive Web App capabilities