Adds the single source of truth for bread GUI styling so the apps stop each re-implementing (and drifting on) component CSS: - stylesheet(&Palette): full component sheet (buttons, entries, switches, dropdowns, lists/rows/sidebars, cards, chips, scrollbars, headings) built from the design tokens + a canonical @define-color block (surface=color0, overlay=color7, accent=color4). - render() / shared_css_path() / write_shared_css(): render for the current pywal palette and write to $XDG_RUNTIME_DIR/bread/theme.css. - gtk::apply_shared(): load that file (or a rendered fallback) at APPLICATION priority and watch it, so every app recolours live with no rebuild. - new `bread-theme` CLI (generate|path|print) — gtk-free, light. Run at session start and on palette change; apps pick it up via the file watch. The contract is a CSS *file*, so apps stay decoupled from this crate's gtk4 version. Tests cover the stylesheet, path, and render helpers.
26 lines
877 B
TOML
26 lines
877 B
TOML
[package]
|
|
name = "bread-theme"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
description = "Shared pywal + Catppuccin theming crate for the bread ecosystem"
|
|
repository = "https://github.com/Breadway/bread-ecosystem"
|
|
keywords = ["theming", "pywal", "gtk4", "wayland"]
|
|
|
|
[dependencies]
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
dirs = { workspace = true }
|
|
gtk4 = { version = "0.11", features = ["v4_12"], optional = true }
|
|
|
|
[features]
|
|
# Enable GTK4 CSS provider helpers (breadbar, breadbox, breadpad use this).
|
|
# bread (daemon) and breadcrumbs (CLI) depend on this crate without the feature.
|
|
gtk = ["dep:gtk4"]
|
|
|
|
# The generator CLI. It only touches the gtk-free lib API (render + write), so
|
|
# it builds without the gtk feature and stays light.
|
|
[[bin]]
|
|
name = "bread-theme"
|
|
path = "src/bin/bread-theme.rs"
|