From 619a2ab70cb67e7d9c5a11b7dfd846b80622925d Mon Sep 17 00:00:00 2001 From: bach Date: Sat, 5 Sep 2026 17:01:39 +0200 Subject: [PATCH] Stop hiding the top bar globally -- it hid the Save button on entity edit forms .top-bar was unconditionally hidden on every page (admin_chrome library) on the assumption it always renders empty, which held on our own pages but not on entity edit forms, where Gin puts the page's local actions -- Save included -- inside .top-bar. Folded it into the same route-scoped library as the admin sidebar (renamed hide_admin_sidebar -> hide_admin_chrome) so both are hidden only on our front-end routes and real admin pages keep a working Save button. --- .../figli_compta_ledger/css/admin-chrome.css | 22 ++------------- .../css/hide-admin-chrome.css | 28 +++++++++++++++++++ .../css/hide-admin-sidebar.css | 13 --------- .../figli_compta_ledger.libraries.yml | 4 +-- .../figli_compta_ledger.module | 15 ++++------ 5 files changed, 39 insertions(+), 43 deletions(-) create mode 100644 web/modules/custom/figli_compta_ledger/css/hide-admin-chrome.css delete mode 100644 web/modules/custom/figli_compta_ledger/css/hide-admin-sidebar.css diff --git a/web/modules/custom/figli_compta_ledger/css/admin-chrome.css b/web/modules/custom/figli_compta_ledger/css/admin-chrome.css index cd93155..cb5a2fc 100644 --- a/web/modules/custom/figli_compta_ledger/css/admin-chrome.css +++ b/web/modules/custom/figli_compta_ledger/css/admin-chrome.css @@ -1,23 +1,7 @@ -/* Core Navigation's top bar (`.top-bar`) only shows itself when its - tools/context/actions regions are non-empty -- but with no blocks placed - there, the regions still contain whitespace text nodes from the Twig - loop scaffolding, which defeats the `:not(:empty)` check. Result: an - empty top bar renders anyway, with the page content pushed down to make - room for it. We only use the Gin sidebar (the left icon rail), so force - the phantom bar off and collapse the space it would otherwise reserve. */ -.top-bar { - display: none !important; -} - -.top-bar ~ .dialog-off-canvas-main-canvas { - margin-block-start: 0 !important; -} - /* Grand livre / Dashboard switcher, top-right of both pages. Only present - on those two custom routes, but attached here (already loaded on every - page for the phantom-top-bar fix above) rather than duplicated between - home.css and dashboard.css -- and defined with its own explicit colors - rather than relying on either page's #figli-*-app-scoped custom + on those two custom routes, but attached here rather than duplicated + between home.css and dashboard.css -- and defined with its own explicit + colors rather than relying on either page's #figli-*-app-scoped custom properties, since this