Skip to content

Theming and Material 3

Bruh edited this page Nov 27, 2026 · 1 revision

Theming and Material 3

Materialized Linux implements Material 3 from spec, not from a web widget or simulated values. The pipeline runs from a wallpaper all the way to live application chrome.

libm3 - the color engine (C++20, no dependencies)

Location: libs/libm3.

  • CAM16/HCT color conversion.
  • Tonal palettes and dynamic schemes, including the Expressive variant.
  • Wallpaper quantization and seed selection.
  • Contrast-aware color roles.

Verified against Google's material-color-utilities (vendored under third_party/src/material-color-utilities). Decision record: D-010 in Design Decisions.

Tokens - single source of truth

design/tokens/materialized.tokens.json is compiled by tools/token-compiler.py into QML, CSS and C++ artifacts with accessibility checks. Covered by 13 Python unit tests:

python3 -m unittest tests.unit.token_compiler_test -v

libm3-qt - the QML design system

Location: libs/libm3-qt. Provides the M3Theme singleton and Material controls (M3Button, M3Switch, M3Label, ...).

Material 3 Expressive features, covered by the m3theme unit test:

  • Spring-physics motion tokens: M3Theme.spring() with under-damped spatial springs and critically damped effects springs.
  • Press shape morphing on buttons and switches.
  • Emphasized typography with variable font weight (M3Theme.fontEmphasized(), M3Label.emphasized).
  • The Expressive color variant, selectable in Settings, Appearance, Color style.

Typography uses Inter as the M3 typeface (Google Sans is unavailable for redistribution, decision D-014); icons are a custom Material-symbol-consistent set with symbolic fallback (D-015).

matsessiond - the live theme service

Location: shell/matsessiond.

  1. Decodes a wallpaper with Qt.
  2. Quantizes it with libm3 and extracts a seed.
  3. Generates light and dark dynamic schemes.
  4. Atomically writes scheme artifacts: JSON, QML, GTK CSS, xrdb, and a Firefox userChrome.css.
  5. Exposes theme controls over D-Bus (org.materialized.Theme1), including SetVariant for the Expressive color style.

Changing the wallpaper or the color style in Settings regenerates the scheme and propagates it live to the shell, apps and the browser chrome.

Firefox chrome

Firefox ESR is launched through /usr/bin/matbrowser, which applies the generated Material 3 userChrome.css from the live wallpaper scheme and uses a dedicated profile under ~/.local/share/materialized/firefox-profile. The browser is packaged, not forked (decision D-020).

Try it locally

bash build/test-theme.sh

This decodes the real wallpaper design/wallpaper/materialized-dawn.png, generates light/dark schemes, loads them in the QML gallery and captures a screenshot in build/screenshots/.

ctest --test-dir build/qml --output-on-failure   # M3 Expressive theme tokens

See also: Architecture, Testing, docs/ARCHITECTURE.md.

Clone this wiki locally