Fix illegible text on light pywal palettes + hot-reload
All checks were successful
Mirror to GitHub / mirror (push) Successful in 3s

Use bread-theme 0.2.7's luminance-picked ink (@on-*): type chips on @overlay and
selected sidebar rows / confirm buttons on @blue kept @fg or @bg, which vanished
when those slots came out light/dark. They now use @on-overlay / @on-accent.

Add breadpad_shared::theme::apply_live (wraps bread_theme::gtk::apply_app_css) so
breadpad and breadman recolour live on `bread-theme reload` and re-read the user's
style.css — replacing the build-once provider. bread-theme bumped to v0.2.7
(gtk feature).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Breadway 2026-06-17 12:42:12 +08:00
parent 35e0481314
commit 1671439f90
5 changed files with 27 additions and 39 deletions

View file

@ -1,5 +1,18 @@
pub use bread_theme::{load_palette, Palette};
/// Apply breadpad/breadman's stylesheet and keep it live across palette changes.
/// [`build_css`] bundles the shared component sheet with the app's own rules from
/// the current pywal palette; `bread_theme::gtk::apply_app_css` re-runs this
/// whenever `bread-theme reload` rewrites the shared theme file, so the UI
/// recolours in place (and re-reads the user's `style.css` override too).
pub fn apply_live() {
bread_theme::gtk::apply_app_css(|| {
let palette = load_palette();
let user_css = std::fs::read_to_string(crate::config::style_css_path()).ok();
build_css(&palette, user_css.as_deref())
});
}
/// Generate the full breadpad/breadman CSS string. The base — `@define-color`
/// palette, fonts, and generic widget styling — comes from the shared
/// `bread_theme::stylesheet`, so breadpad and breadman look identical to the
@ -32,7 +45,7 @@ window { border-radius: 8px; }
.type-chip {
background: @overlay;
color: @fg;
color: @on-overlay;
border-radius: 999px;
padding: 4px 12px;
font-size: 12px;
@ -41,12 +54,12 @@ window { border-radius: 8px; }
.type-chip.active {
background: @blue;
color: @bg;
color: @on-accent;
}
.confirm-button {
background: @blue;
color: @bg;
color: @on-accent;
border: none;
border-radius: 8px;
padding: 8px 16px;
@ -90,7 +103,7 @@ window { border-radius: 8px; }
.sidebar-row:selected {
background: @blue;
color: @bg;
color: @on-accent;
font-weight: 500;
}