From 6e5937591043ad969af94866f5081483eb147b14 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Wed, 26 Jun 2024 11:53:21 +0000
Subject: [PATCH] Bug 36337: Hiding lists with OpacPublic breaks styling for
 language list

This patch adjusts the CSS of elements in the OPAC header so that menu
items are correctly aligned with various combinations of the OpacPublic
and OpacLangSelectorMode system preferences.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- View the header menu in the OPAC with these combinations of settings:
  - OpacPublic = On; OpacLangSelectorMode = Top;
  - OpacPublic = On; OpacLangSelectorMode = Footer;
  - OpacPublic = Off; OpacLangSelectorMode = Top;
  - OpacPublic = Off; OpacLangSelectorMode = Footer;
- With each configuration, test that the elements in the header (Logo,
  Cart/List menu, Language selctor, and user menu items) align
  correctly. The Cart/List menu items should always align to the left,
  the Language selector and user menu should aways align to the right.

Sponsored-by: Athens County Public Libraries
---
 .../opac-tmpl/bootstrap/css/src/_common.scss  | 20 ++++++++++++++++++-
 .../opac-tmpl/bootstrap/css/src/opac.scss     |  7 +++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss
index 6dbc6cc393..79b832a711 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss
+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss
@@ -861,7 +861,6 @@ button {
 #logo {
     background: transparent url( "../images/koha-green-logo.svg" ) no-repeat scroll 0%;
     border: 0;
-    float: left !important;
     margin: 0;
     padding: 0;
     width: 100px;
@@ -883,6 +882,25 @@ button {
     }
 }
 
+#header-region .navbar {
+    #logo {
+        flex-grow: 1;
+        flex-shrink: 0;
+    }
+
+    &:has( #cart-list-nav ) {
+        #logo {
+            flex-grow: 0;
+            flex-shrink: 1;
+        }
+
+        #cart-list-nav {
+            flex-grow: 1;
+            flex-shrink: 0;
+        }
+    }
+}
+
 #changelanguage {
     background-color: #FFF;
     border-top: 1px solid #EEE;
diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
index da3a8c4206..ccad6cd625 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
@@ -343,9 +343,12 @@ th {
     margin: .2rem .2rem .2rem 0;
 }
 
+#header_langmenu {
+    flex-shrink: 1;
+}
+
 #members {
-    flex-grow: 1;
-    justify-content: flex-end;
+    flex-shrink: 1;
 
     p {
         color: #727272;
-- 
2.39.2