Repository navigation
feat(appearance): load an optional user stylesheet - #1758
Conversation
Strata pins its own appearance and deliberately ignores ~/.config/gtk-4.0/gtk.css, which leaves no supported way to tweak the interface beyond the color tokens. Load ~/.config/strata/style.css, when present, through a provider above every Strata stylesheet, so its rules win and the active theme's @strata_* colors are available. The file is watched like custom themes: edits apply to open windows after a short debounce, deleting it restores the default appearance, and rules GTK cannot parse are logged as warnings. Refs lgse#1710
…the user stylesheet Hoist the color comparison used by the user-stylesheet test into a test helper, name the GTK isolation test after gtk.css now that Strata has a user stylesheet of its own, and link the new docs section from the README.
|
Review of the diff against Verdict: no merge blockers. The provider sits one priority step above the token provider, so user rules win over Strata's own and still see the active theme's Pushed in
Test audit: Local verification (review worktree): CI: the fork's workflow run needed maintainer approval; approved after review. |
…ompat-followups Resolves the catalog, services, preview test, context menu, theme and typed-navigation conflicts, and adapts what main added since the fork to this branch's rules: - The user stylesheet (#1758) is watched through the monitors worker and re-read off the UI thread. - The Diagnostics page (#1735) and the Integrations page (#1748) detect the package manager and resolve the terminal off the UI thread; the Run-in-terminal button spawns through the reaper closure. - Connect to server (#1726) waits for a native path's asynchronous validation instead of pinning and closing at once. - The pinned-places tests read the GTK bookmarks file through adapters::bookmarks after the settings writer settles. - Traditional Chinese (#1745) gets the strings this branch adds.
Description
Adds an opt-in user stylesheet, as discussed in #1710. When
~/.config/strata/style.cssexists, Strata loads it through its own CSS provider above every stylesheet Strata ships, so user rules have the final word and can use the active theme's@strata_*colors. Without the file the provider stays empty and nothing changes.The file is watched the same way as custom themes: edits apply to open windows after a short debounce, deleting the file restores the default look, and rules GTK cannot parse are skipped and logged as warnings.
~/.config/gtk-4.0/gtk.cssremains ignored, as before.docs/themes.mddocuments the file and notes that class names are not a stable interface.The implementation was written with the help of an AI coding assistant; I reviewed and tested it and the commit is my own.
Visual evidence
N/A. This adds an opt-in file and changes nothing by default. With the file present, the rules in it restyle the interface: for example,
.sidebar-shell { margin: 8px; border-radius: 16px; }turns the sidebar into a floating rounded card, as described in #1710.How to test
~/.config/strata/style.csswith.sidebar-shell { margin: 8px; border-radius: 16px; background: alpha(@strata_accent, 0.25); }.0.5, then add an invalid rule such as.sidebar { color: nope; }and save again.Expected result: the sidebar turns into a rounded, accent-tinted card as soon as the file is saved and follows each edit; the invalid rule is skipped with a
invalid rule in user stylesheetwarning in the log while the valid rules keep applying; after deleting the file the sidebar returns to the default appearance. Switching themes keeps the override and updates its@strata_*colors.Related issue
Closes #1710