Style Architecture
Jet has a two-file style architecture:styles.scss
Material Design theme configuration and global Material component overrides
app-styles.scss
Application-specific utility classes and custom styles
angular.json:
Generating a Material Theme
Jet’s theme is generated from a primary color using Angular Material’s theme generator.Choose your primary color
When prompted, enter your primary color (hex value):The current Jet theme uses
#6e4b3a (a warm brown).Generated output
This creates or updates
_theme-colors.scss with a complete Material 3 color palette:- Primary, secondary, tertiary palettes
- Neutral and neutral-variant palettes
- Error palette
- All tonal variations (0-100)
Understanding the Theme File
The generated_theme-colors.scss contains:
Theme Configuration
Typography
Jet uses custom font families defined instyles.scss:
Arabic Language Support
When Arabic is selected, the app switches font families:Color Scheme Support
Jet supports automatic, light, and dark color schemes:color-scheme CSS property automatically switches Material 3 themes between light and dark.
Overriding Material Styles
Jet uses Material’s override mixins to customize component appearances:Card Overrides
List Overrides
Sidenav Overrides
Other Component Overrides
Jet also overrides:- Chips
- Expansion panels
- Tabs
- Toolbars (transparent backgrounds for specific toolbars)
src/styles.scss for the complete list.
Custom Utility Classes
Jet provides utility classes insrc/app-styles.scss:
Adding New Utilities
Add utility classes toapp-styles.scss:
Material Design Tokens
Jet uses Material 3 design tokens for consistent styling:Color Tokens
Typography Tokens
Shape Tokens
Using Tokens in Components
In component SCSS files:Safe Area Support
Jet includes safe area insets for mobile devices:- Phone notches
- Home indicators
- Rounded screen corners
RTL Support
Jet automatically handles RTL layouts:Component Styles
Each component can have its own SCSS file:Component Style Budget
Jet enforces a component style budget:- Warning at 4kB
- Error at 8kB
Best Practices
Use Material Design tokens
Use Material Design tokens
Always use Material Design tokens instead of hardcoded colors:
Use logical properties for RTL support
Use logical properties for RTL support
Use logical properties that work in both LTR and RTL:
Keep component styles scoped
Keep component styles scoped
Use
:host to scope component styles:Use utility classes for common patterns
Use utility classes for common patterns
Create reusable utility classes in
app-styles.scss instead of duplicating styles.Test in both light and dark modes
Test in both light and dark modes
Always test your styles in both color schemes to ensure proper contrast and readability.