Skip to main content

orbital_theme/
overrides.rs

1use crate::{Density, ThemeMode};
2
3#[derive(Clone, Debug, Default)]
4pub struct BrandPalette {
5    pub primary: String,
6}
7
8#[derive(Clone, Debug, Default)]
9pub struct ThemeOverrides {
10    pub mode: Option<ThemeMode>,
11    pub brand: Option<BrandPalette>,
12    pub density: Option<Density>,
13    pub typography: Option<TypographyOverrides>,
14    pub spacing: Option<SpacingScale>,
15    pub elevation: Option<ElevationScale>,
16    pub shape: Option<ShapeOverrides>,
17}
18
19#[derive(Clone, Debug, Default)]
20pub struct TypographyOverrides {
21    pub font_family_base: Option<String>,
22    pub font_family_monospace: Option<String>,
23    pub font_family_numeric: Option<String>,
24    pub font_family_display: Option<String>,
25    pub font_size_scale: Option<f32>,
26    pub line_height_scale: Option<f32>,
27}
28
29#[derive(Clone, Copy, Debug)]
30pub struct SpacingScale {
31    pub multiplier: f32,
32}
33
34#[derive(Clone, Copy, Debug)]
35pub struct ElevationScale {
36    pub multiplier: f32,
37}
38
39impl Default for ElevationScale {
40    fn default() -> Self {
41        Self { multiplier: 1.0 }
42    }
43}
44
45#[derive(Clone, Copy, Debug, Default)]
46pub struct ShapeOverrides {
47    pub border_radius_scale: Option<f32>,
48}