Skip to content

Commit be47015

Browse files
authored
Navbar fixes (#25402)
Fixes: #25444 Followup for some regressions from #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">
1 parent 9c62ca5 commit be47015

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

templates/base/head_navbar.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
</a>
1212

1313
<!-- 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 -->
14-
<div class="ui secondary menu item navbar-mobile-right gt-gap-2">
14+
<div class="ui secondary menu item navbar-mobile-right">
1515
{{if .IsSigned}}
16-
<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"}}">
16+
<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"}}">
1717
<div class="gt-relative">
1818
{{svg "octicon-bell"}}
1919
<span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
2020
</div>
2121
</a>
2222
{{end}}
23-
<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>
23+
<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>
2424
</div>
2525

2626

web_src/css/helpers.css

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Gitea's private styles use `g-` prefix.
7575
.gt-self-start { align-self: flex-start !important; }
7676
.gt-self-end { align-self: flex-end !important; }
7777
.gt-no-underline { text-decoration-line: none !important; }
78+
.gt-w-auto { width: auto !important; }
7879

7980
.gt-overflow-x-auto { overflow-x: auto !important; }
8081
.gt-overflow-x-scroll { overflow-x: scroll !important; }

web_src/css/modules/navbar.css

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
justify-content: center;
3535
}
3636

37+
#navbar .dropdown .item {
38+
justify-content: stretch;
39+
}
40+
3741
#navbar a.item:hover,
3842
#navbar button.item:hover {
3943
background: var(--color-nav-hover-bg);
@@ -85,19 +89,19 @@
8589
#navbar.navbar-menu-open .item {
8690
display: flex;
8791
width: 100%;
92+
margin: 0;
8893
}
8994
#navbar.navbar-menu-open .navbar-left #navbar-logo {
9095
justify-content: flex-start;
91-
width: 50%;
92-
min-height: 48px;
96+
width: auto;
9397
}
9498
#navbar.navbar-menu-open .navbar-left .navbar-mobile-right {
9599
justify-content: flex-end;
96100
width: 50%;
97101
min-height: 48px;
98102
}
99-
#navbar.navbar-menu-open .mobile-right-item {
100-
width: auto !important;
103+
#navbar #mobile-notifications-icon {
104+
margin-right: 6px !important;
101105
}
102106
}
103107

0 commit comments

Comments
 (0)