diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 3086e674fd..a2be0187d9 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -11,16 +11,16 @@ </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> diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index 090993226c..520a199682 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -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; } diff --git a/web_src/css/modules/navbar.css b/web_src/css/modules/navbar.css index abc6afc690..66c7f9ec78 100644 --- a/web_src/css/modules/navbar.css +++ b/web_src/css/modules/navbar.css @@ -34,6 +34,10 @@ justify-content: center; } +#navbar .dropdown .item { + justify-content: stretch; +} + #navbar a.item:hover, #navbar button.item:hover { background: var(--color-nav-hover-bg); @@ -85,19 +89,19 @@ #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; } }