zen: register the theme sheet at agent level

As a user sheet it sorted below userChrome.css and lost every !important to
the copy parsed at startup. Agent sheets sort above ua.css; @-moz-document
keeps that origin off web pages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-31 20:18:32 +01:00
parent d9604900e3
commit 0e980586d0
2 changed files with 25 additions and 14 deletions

View file

@ -532,7 +532,17 @@ let
# userChrome.css the result is the old behaviour — themed on next launch —
# never an unthemed browser.
install -Dm644 "$theme/zen.css" "$HOME/${zenChrome}/userChrome.css"
install -Dm644 "$theme/zen.css" "$HOME/${zenChrome}/zen-theme.css"
# Same CSS again, at agent level via the watcher in apps/zen.nix, which is
# the copy that actually changes a running window — a user-level sheet is
# ordered below userChrome.css and loses every !important to it. Agent
# origin applies to web pages too, hence the @-moz-document scope; the
# startup copy above stays unwrapped so it survives even if that syntax is
# ever dropped for user sheets.
{
echo '@-moz-document url-prefix(chrome://) {'
cat "$theme/zen.css"
echo '}'
} > "$HOME/${zenChrome}/zen-theme.css"
# Icon theme: replace the directory contents (cheap — the tree is
# symlinks into the papirus store path) so GTK's icon-theme monitor sees