pub struct DefaultTheme {Show 25 fields
pub fonts: ThemeFontFamilies,
pub colors: ThemeColors,
pub density: ThemeDensity,
pub control_size: Option<ControlSize>,
pub spacing: f32,
pub breakpoints: ThemeBreakpoints,
pub containers: ThemeContainers,
pub text: ThemeTextScale,
pub font_weights: ThemeFontWeights,
pub tracking: ThemeTracking,
pub leading: ThemeLeading,
pub radius: ThemeRadii,
pub shadows: ThemeShadows,
pub glows: ThemeGlows,
pub blur: ThemeBlurScale,
pub perspective: ThemePerspective,
pub aspect: ThemeAspectRatios,
pub motion: ThemeMotion,
pub hdr: HdrThemeTokens,
pub palette: ControlPalette,
pub surfaces: SurfacePalette,
pub decorative: DecorativePalette,
pub typography: ControlTypography,
pub interaction: ControlStateMetrics,
pub metrics: ControlMetrics,
}Fields§
§fonts: ThemeFontFamilies§colors: ThemeColors§density: ThemeDensity§control_size: Option<ControlSize>Contextual authored size, when this theme copy is scoped to an interface surface.
spacing: f32§breakpoints: ThemeBreakpoints§containers: ThemeContainers§text: ThemeTextScale§font_weights: ThemeFontWeights§tracking: ThemeTracking§leading: ThemeLeading§radius: ThemeRadii§shadows: ThemeShadows§glows: ThemeGlowsLive-signal glow halos (--sm-glow-*): empty in Light, damped in the
true-black theme. Paint with paint_theme_shadow.
blur: ThemeBlurScale§perspective: ThemePerspective§aspect: ThemeAspectRatios§motion: ThemeMotion§hdr: HdrThemeTokens§palette: ControlPalette§surfaces: SurfacePalette§decorative: DecorativePaletteDerived roles for the categorical decorative hues.
typography: ControlTypography§interaction: ControlStateMetrics§metrics: ControlMetricsImplementations§
Source§impl DefaultTheme
impl DefaultTheme
pub fn new() -> Self
Sourcepub fn neutral() -> Self
pub fn neutral() -> Self
A neutral light theme for serious, professional interfaces without an application-specific color preference.
Sourcepub fn neutral_dark() -> Self
pub fn neutral_dark() -> Self
Dark companion to Self::neutral.
pub fn high_contrast() -> Self
Sourcepub fn void() -> Self
pub fn void() -> Self
The true-black OLED theme (“Void”): borders instead of shadows, dimmed
whites, damped glows. Alias for Self::high_contrast.
pub fn compact() -> Self
pub fn comfortable() -> Self
pub fn touch() -> Self
Sourcepub fn from_colors(colors: ThemeColors) -> Self
pub fn from_colors(colors: ThemeColors) -> Self
Build a theme from source colors, deriving every palette role. The built-in presets cache their result; call this for custom palettes.
pub fn with_density(self, density: ThemeDensity) -> Self
Sourcepub fn with_size(self, size: ControlSize) -> Self
pub fn with_size(self, size: ControlSize) -> Self
Apply contextual interface sizing without changing the text-scale ramp.
The existing density tiers provide the mature detailed metric ladders
behind Small, Medium, and Large. The authored size contract then
normalizes the primary control, row, icon, and control-text tokens while
leaving the caller’s text ramp intact.
pub fn sync_derived_fields(&mut self)
pub fn text_style(&self, color: Color) -> TextStyle
Sourcepub fn serif_text_style(&self, color: Color) -> TextStyle
pub fn serif_text_style(&self, color: Color) -> TextStyle
Build a text style using the theme’s serif family preference stack.
Sourcepub fn mono_text_style(&self, color: Color) -> TextStyle
pub fn mono_text_style(&self, color: Color) -> TextStyle
Build a text style using the theme’s monospace family preference stack.
pub fn semantic_tone_colors(&self, tone: SemanticTone) -> (Color, Color)
Sourcepub fn glow_for_output(
&self,
tone: GlowTone,
output: Option<OutputColorRange>,
) -> ThemeShadow
pub fn glow_for_output( &self, tone: GlowTone, output: Option<OutputColorRange>, ) -> ThemeShadow
The theme’s tone glow as it should look on output.
Where the theme’s HDR mode and the output allow it, each halo takes the HDR variant of the tone’s color, as bright as an emissive indicator may be, or its wide-gamut variant on a wide-gamut output, keeping the halo’s own alpha. Elsewhere, and whenever the theme turns HDR effects off, the glow is the theme’s token. Light themes have no glow.
Sourcepub fn tone_roles(&self, tone: SemanticTone) -> ToneRoles
pub fn tone_roles(&self, tone: SemanticTone) -> ToneRoles
The complete role set for a semantic tone. Neutral resolves to the
neutral button face: white with an outline in light themes, a raised
fill in dark themes, always with full-strength ink.
pub fn semantic_tone_color(&self, tone: SemanticTone) -> Color
pub fn semantic_tone_text_color(&self, tone: SemanticTone) -> Color
Sourcepub fn semantic_tone_soft_colors(&self, tone: SemanticTone) -> (Color, Color)
pub fn semantic_tone_soft_colors(&self, tone: SemanticTone) -> (Color, Color)
Soft pair for an explicitly semantic tone: a restrained wash to fill
with and tone-hued ink that stays legible on it. Use for badges and
callouts; selected rows use the neutral selection role. The solid
pair from Self::semantic_tone_colors is for filled controls.
Sourcepub fn for_disabled_control(self) -> Self
pub fn for_disabled_control(self) -> Self
This theme as a disabled control draws with it: text and placeholders take the disabled ink, fills fade toward the control tier, and borders and accents lose strength, so a widget that paints with the result looks disabled without colors of its own.