Skip to content

Commit d842c7e

Browse files
Gustedlunny
authored andcommitted
By default force vertical tabs on mobile (go-gitea#19486)
* By default force vertical tabs on mobile - While experimenting with using vertical tabs instead of horizontal tabs on gitea for a better mobile experience, I made a recent PR(go-gitea#19468) in order to see if there was any objections to this new behavior for the repo headers(one of the most annoying horizontal tabs). This PR had no objections and even a user commenting that this change is brilliant. - This PR now improves upon the previous PR by making this the de-facto behavior for all menu's on mobile. The only exemption is the navbar which also uses the menu but caught some layout errors with the changes. * Fix organisation * Fix repo/wiki buttons Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent a9fc686 commit d842c7e

File tree

6 files changed

+17
-33
lines changed

6 files changed

+17
-33
lines changed

templates/base/head.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{{template "custom/body_inner_pre" .}}
8686

8787
{{if not .PageIsInstall}}
88-
<div class="ui top secondary stackable main menu following bar light">
88+
<div class="ui top secondary stackable main menu following bar light no-vertical-tabs">
8989
{{template "base/head_navbar" .}}
9090
</div><!-- end bar -->
9191
{{end}}

templates/repo/header.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
</div><!-- end grid -->
146146
</div><!-- end container -->
147147
{{end}}
148-
<div class="ui tabs container repo-header-container">
148+
<div class="ui tabs container">
149149
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
150150
<div class="ui tabular stackable menu navbar">
151151
{{if .Permission.CanRead $.UnitTypeCode}}

templates/repo/home.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</div>
6161
{{end}}
6262
{{template "repo/sub_menu" .}}
63-
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
63+
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins no-vertical-tabs">
6464
{{template "repo/branch_dropdown" dict "root" .}}
6565
{{ $n := len .TreeNames}}
6666
{{ $l := Subtract $n 1}}

templates/repo/wiki/view.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{template "repo/header" .}}
44
{{ $title := .title}}
55
<div class="ui container">
6-
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
6+
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins no-vertical-tabs">
77
<div class="fitted item">
88
<div class="choose page">
99
<div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">

web_src/less/_base.less

+13-14
Original file line numberDiff line numberDiff line change
@@ -1350,27 +1350,13 @@ footer {
13501350
overflow: auto;
13511351
}
13521352

1353-
@media @mediaSm {
1354-
.ui.menu.new-menu {
1355-
overflow: visible !important;
1356-
}
1357-
}
1358-
13591353
.ui.menu.new-menu .new-menu-inner {
13601354
display: flex;
13611355
margin-left: auto;
13621356
margin-right: auto;
13631357
overflow-x: auto;
13641358
}
13651359

1366-
@media @mediaSm {
1367-
.ui.menu.new-menu .new-menu-inner {
1368-
flex-wrap: wrap;
1369-
margin-left: 0;
1370-
margin-right: 0;
1371-
}
1372-
}
1373-
13741360
.ui.menu.new-menu::after {
13751361
position: absolute;
13761362
display: block;
@@ -2194,3 +2180,16 @@ table th[data-sortt-desc] {
21942180
height: 15px;
21952181
}
21962182
}
2183+
2184+
@media @mediaSm {
2185+
.ui.stackable.menu:not(.no-vertical-tabs) {
2186+
overflow-y: hidden;
2187+
overflow-x: auto;
2188+
flex-direction: row;
2189+
flex-wrap: nowrap !important;
2190+
2191+
.item {
2192+
width: initial !important;
2193+
}
2194+
}
2195+
}

web_src/less/_repository.less

-15
Original file line numberDiff line numberDiff line change
@@ -3237,18 +3237,3 @@ td.blob-excerpt {
32373237
transform: scale(105%);
32383238
box-shadow: 0 .5rem 1rem var(--color-shadow) !important;
32393239
}
3240-
3241-
@media @mediaSm {
3242-
.repo-header-container {
3243-
overflow-x: auto;
3244-
overflow-y: hidden;
3245-
3246-
.ui.stackable.menu {
3247-
flex-direction: row;
3248-
3249-
.item {
3250-
width: initial !important;
3251-
}
3252-
}
3253-
}
3254-
}

0 commit comments

Comments
 (0)