]> source.dussan.org Git - gitea.git/commitdiff
Navbar fixes (#25402)
authorsilverwind <me@silverwind.io>
Sat, 24 Jun 2023 04:31:39 +0000 (06:31 +0200)
committerGitHub <noreply@github.com>
Sat, 24 Jun 2023 04:31:39 +0000 (04:31 +0000)
Fixes: https://github.com/go-gitea/gitea/issues/25444
Followup for some regressions from
https://github.com/go-gitea/gitea/pull/25343. Before and after:

<img width="219" alt="Screenshot 2023-06-21 at 00 25 20"
src="https://github.com/go-gitea/gitea/assets/115237/08fe8e01-0a16-4cdf-ad4d-0a9048408e9e">
<img width="220" alt="Screenshot 2023-06-21 at 00 25 32"
src="https://github.com/go-gitea/gitea/assets/115237/be25ae69-6ed0-4af5-8eeb-d7b210e7c124">

Fixes mobile button background and margins:

<img width="836" alt="Screenshot 2023-06-21 at 00 39 58"
src="https://github.com/go-gitea/gitea/assets/115237/d76ac1e9-747f-477c-9a42-b73e129b72ee">

templates/base/head_navbar.tmpl
web_src/css/helpers.css
web_src/css/modules/navbar.css

index 3086e674fd6212b8c853a1c880a9b275f315dfdb..a2be0187d9c40d6150c2bbc61d647bc2e2c894d1 100644 (file)
                </a>
 
                <!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
-               <div class="ui secondary menu item navbar-mobile-right gt-gap-2">
+               <div class="ui secondary menu item navbar-mobile-right">
                        {{if .IsSigned}}
-                       <a class="item mobile-right-item gt-mr-2 gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
+                       <a id="mobile-notifications-icon" class="item gt-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
                                <div class="gt-relative">
                                        {{svg "octicon-bell"}}
                                        <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
                                </div>
                        </a>
                        {{end}}
-                       <button class="item mobile-right-item ui icon mini button gt-p-3 gt-m-0" id="navbar-expand-toggle">{{svg "octicon-three-bars"}}</button>
+                       <button class="item gt-w-auto ui icon mini button gt-p-3 gt-m-0" id="navbar-expand-toggle">{{svg "octicon-three-bars"}}</button>
                </div>
 
 
index 090993226cb1f05ecd7579f2f617b10c591a6986..520a1996825d8ffee8079fee853d057fe927359d 100644 (file)
@@ -75,6 +75,7 @@ Gitea's private styles use `g-` prefix.
 .gt-self-start { align-self: flex-start !important; }
 .gt-self-end { align-self: flex-end !important; }
 .gt-no-underline { text-decoration-line: none !important; }
+.gt-w-auto { width: auto !important; }
 
 .gt-overflow-x-auto { overflow-x: auto !important; }
 .gt-overflow-x-scroll { overflow-x: scroll !important; }
index abc6afc69037fbcdaeb646dcdbd5c1602ff10742..66c7f9ec789ca52d3e695fd198279c21f1a6d726 100644 (file)
   justify-content: center;
 }
 
+#navbar .dropdown .item {
+  justify-content: stretch;
+}
+
 #navbar a.item:hover,
 #navbar button.item:hover {
   background: var(--color-nav-hover-bg);
   #navbar.navbar-menu-open .item {
     display: flex;
     width: 100%;
+    margin: 0;
   }
   #navbar.navbar-menu-open .navbar-left #navbar-logo {
     justify-content: flex-start;
-    width: 50%;
-    min-height: 48px;
+    width: auto;
   }
   #navbar.navbar-menu-open .navbar-left .navbar-mobile-right {
     justify-content: flex-end;
     width: 50%;
     min-height: 48px;
   }
-  #navbar.navbar-menu-open .mobile-right-item {
-    width: auto !important;
+  #navbar #mobile-notifications-icon {
+    margin-right: 6px !important;
   }
 }