Expand shell-theme UI control: typography, [panel]/[osd], [[bar.widget]] (v0.7.8) #11

Merged
Breadway merged 6 commits from feature/theme-typography into main 2026-09-04 14:32:30 +08:00
Owner

Four axes of theme UI control, all defaulting to the current rendering:

  1. Typography — font_family/_fallback/_size_base + new font_weight drive the whole bar + launcher + shared stylesheet (was launcher-only). liquid-motion pinned to today values.
  2. Chrome tokens — sep_style, bar_shadow, chip_gap, ws_gradient_angle, media_eq_style, osd_style.
  3. [panel] / [osd] — panel min_width + sections; osd enabled + dismiss_ms.
  4. bar.widget — declarative live bar widget (poll + node tree).
  • standalone themes render from base.css; docs (supersedes #9); version bump 0.7.7->0.7.8. 112 tests, clippy clean, goldens byte-equivalent for liquid-motion.

breadbar side: Breadway/breadbar#feature/theme-ui-control (repin follows this tag).

Four axes of theme UI control, all defaulting to the current rendering: 1. **Typography** — font_family/_fallback/_size_base + new font_weight drive the whole bar + launcher + shared stylesheet (was launcher-only). liquid-motion pinned to today values. 2. **Chrome tokens** — sep_style, bar_shadow, chip_gap, ws_gradient_angle, media_eq_style, osd_style. 3. **[panel] / [osd]** — panel min_width + sections; osd enabled + dismiss_ms. 4. **[[bar.widget]]** — declarative live bar widget (poll + node tree). + standalone themes render from base.css; docs (supersedes #9); version bump 0.7.7->0.7.8. 112 tests, clippy clean, goldens byte-equivalent for liquid-motion. breadbar side: Breadway/breadbar#feature/theme-ui-control (repin follows this tag).
A shell theme's font_family / font_fallback / font_size_base only reached
breadbox's launcher panel — the whole breadbar bar and every other bread
GTK app rendered a hardcoded 'Varela Round 14px' baked into
bread_theme::stylesheet() as compile-time constants.

- New `font_weight` token (int 100-900, default 400).
- New `Typography` helper resolved from shell::load() (infallible);
  stylesheet() / stylesheet_resolved() / render() take it. font_family_css()
  builds a well-formed quoted family list from font_family + font_fallback
  (fixes the pre-existing `"Outfit, sans-serif", sans-serif` quoting bug in
  the launcher rule).
- base.css: window.breadbar + .launcher-bg carry {font_family_css} /
  {font_size_base} / {font_weight}, so a live theme switch re-fonts the bar
  with no restart. .popover-caret gradient now reads accent_from/accent_to
  instead of a hardcoded @accent/@teal.
- css_template_for(): a standalone theme (neither a builtin nor extending
  one) now renders from the shared base.css instead of an empty template.
- liquid-motion pinned to the historical FONT_* constants (Varela Round /
  14 / 400) so a default install is unchanged; glass-workbench (IBM Plex
  13px) / spotlight / daylight (Outfit) now render their intended fonts.
- Goldens re-blessed; stale "not-yet-consumed" accent comments removed.
Axis 2 of the theme-UI-control expansion. Six CSS-only tokens, each
defaulting to today's rendering (goldens re-blessed show liquid-motion
byte-equivalent):

- sep_style       line | none | dot   — the bar stat-chip divider
- bar_shadow      none | soft | hard  — opt-in drop shadow on bar/segments
- chip_gap        px                  — extra left-margin between bar chips
- ws_gradient_angle deg               — Trail workspace gradient direction
- media_eq_style  bars | none         — the animated media equaliser
- osd_style       pill | bar          — OSD radius (radius_pill vs radius_card)

Derivations in shell/style.rs, wired through base.css placeholders. No
breadbar code change. Bad enum values are a hard error (want_enum in
resolve_tokens).
Axes 3 + 4 of the theme-UI-control expansion, bread-theme side.

[panel] — { min_width (CSS via {panel_min_width}), sections (ordered
subset of volume|output|brightness|system|power|tray) }. Default = all
in current order + 248px, so goldens are unchanged.

[osd] — { enabled (volume|brightness), dismiss_ms }. anchor stays
[surfaces."breadbar-osd"], radius stays the osd_style token.

[[bar.widget]] — a theme-declared live bar widget: an id, a slot
(a widget:<key> that must exist in [bar.slots]), an order, a
bind = { cmd, every } poll, and a node tree (box/label/icon/progress)
mirroring bread_shared::widget::WidgetNode's shape so breadbar maps it
1:1. Node depth/count bounded (4/50); the color/weight/size style vocab
is validated against the same names bread-shared uses; parse_duration
handles ms/s/m. validate_slots gained the widget-has-a-home check.

describe() gains panel / osd / bar.widget blocks. 112 tests.
bread-theme: loaf gets a demo [[bar.widget]] (loadavg chip)
All checks were successful
check / check (push) Successful in 1m57s
9837319835
Proves the declarative-widget path end to end: a warm load-average chip
right of the clock, polled every 5s, no Rust and no Lua. Uses the
widget:right_of_clock slot loaf already carries via its "+" centre splice.
docs: shell-themes guide + the four UI-control axes
All checks were successful
check / check (push) Successful in 2m13s
3a6ef0633e
Folds in the authoring guide from PR #9 (docs/shell-themes.md + the README
Theming section) and extends it for v0.7.8:

- [tokens] table: font_family/_fallback/_size_base now drive the whole
  shell + shared sheet (not launcher-only); + font_weight, chip_gap,
  sep_style, bar_shadow, ws_gradient_angle, media_eq_style, osd_style
- new [panel], [osd], and [[bar.widget]] sections
- live-switch vs restart table updated (panel.sections / osd.enabled
  restart; [[bar.widget]] / panel.min_width / osd.dismiss_ms are live)

Supersedes PR #9 — that branch can be closed.
deps: bump bread-ecosystem to v0.7.8
All checks were successful
check / check (push) Successful in 2m10s
e16f3a36e8
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bread-ecosystem!11
No description provided.