Skip to main content

Crate teksilo_theme_material3

Crate teksilo_theme_material3 

Source
Expand description

Material 3 theme preset for Teksilo.

A static Material 3 theme built on the canonical baseline scheme (seed #6750A4, the M3 reference purple). The preset replaces the IntUI color, shape, and typography tokens with M3 values, exposes the full M3 role palette via Material3Palette, and installs M3 widget chrome (pill-shaped 40 dp buttons, the M3 switch, 12 dp cards) through the Tier-3 style slots.

ⓘ
use teksilo_theme_material3 as m3;

TeksiloAppBuilder::new()
    .theme(m3::light())
    .initial_window(WindowConfig::new().title("M3 demo"))
    .run();

§What’s mapped, and what isn’t

M3’s primary/secondary/tertiary + tonal-surface model doesn’t line up one-to-one with Teksilo’s role taxonomy, so the color mapping projects each ColorTokens field onto its nearest M3 equivalent and exposes the rest (containers, secondary, tertiary, the surface-container ladder) through Material3Palette. Typography keeps Teksilo’s bundled Inter family (which is metrically Roboto-compatible; the text engine would silently fall back to it for an unregistered “Roboto” anyway) and adopts M3’s type-scale sizes / weights / letter-spacing.

§Known limitations

  • State layers are pre-composited. M3 hover/pressed are 8 % / 12 % on-color overlays; Teksilo recipes take opaque colors, so those layers are baked into static colors.
  • Tonal / Destructive button fills are frozen per appearance (RecipeColor::Static) because there is no secondaryContainer / error surface role to track reactively.

Structs§

Material3Palette
Full Material 3 baseline role palette (static reference scheme, seed #6750A4). Installed on the theme via theme.with_extension(...) and read back with theme.extension::<Material3Palette>().

Functions§

dark
Material 3 dark theme (baseline scheme, seed #6750A4).
font_registrar
A FontRegistrar that embeds Roboto and registers it under the “Roboto” family. Pass it to the app builder so the M3 typography (which uses “Roboto” under this feature) resolves instead of falling back to the bundled default:
input_tokens
Material 3’s input tokens for one density ladder.
light
Material 3 light theme (baseline scheme, seed #6750A4).