Skip to main content

orbital_theme/
lib.rs

1//! Orbital theme — CSS variable injection and runtime customization.
2//!
3//! Provides [`OrbitalThemeProvider`] and theme hooks for light/dark mode, brand
4//! color, density, typography, spacing, and elevation overrides.
5//!
6//! ## First-paint baseline
7//!
8//! [`default_first_paint_baseline_css`] and [`ROOT_THEME_SCOPE_ID`] supply SSR shell
9//! CSS (fonts + scoped light-theme vars). Wire into the document shell via
10//! `orbital::OrbitalFirstPaintHeadAssets`. Dark mode, custom brand, and route-specific
11//! brand remain runtime responsibilities after hydration.
12
13mod baseline;
14mod context;
15mod fonts;
16mod hooks;
17mod options;
18mod overrides;
19mod provider;
20mod ramps;
21mod theme;
22mod tokens;
23
24pub use baseline::{
25    baseline_active_in_document, is_baseline_theme, should_skip_root_baseline_injection,
26};
27pub use baseline::{
28    baseline_asset_path, baseline_primary_font_preload_path, baseline_stylesheet_filename,
29    default_first_paint_baseline_css, default_first_paint_baseline_css_with_font_prefix,
30    default_first_paint_theme, theme_baseline_css, theme_baseline_css_with_font_prefix,
31    theme_scoped_vars_css, BASELINE_STYLESHEET_FILENAME, ROOT_THEME_SCOPE_ID,
32};
33pub use context::ThemeInjection;
34pub use fonts::font_faces_css_with_asset_prefix;
35pub use hooks::{
36    set_brand_palette, set_density, set_elevation_scale, set_spacing_scale, set_theme_mode,
37    set_typography, use_set_theme, use_theme_mode, use_theme_options, use_update_theme,
38};
39pub use options::{Density, Direction, ThemeOptions};
40pub use overrides::{
41    BrandPalette, ElevationScale, ShapeOverrides, SpacingScale, ThemeOverrides, TypographyOverrides,
42};
43pub use provider::OrbitalThemeProvider;
44pub use ramps::brand_ramp;
45pub use theme::{Theme, ThemeMode};
46pub use tokens::{ColorTheme, CommonTheme};