Skip to content

Commit 6ccbd11

Browse files
author
Gusted
committed
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.
1 parent fc00286 commit 6ccbd11

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

templates/base/head.tmpl

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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}}

web_src/less/_base.less

Lines changed: 12 additions & 14 deletions
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,15 @@ 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+
2190+
.item {
2191+
width: initial !important;
2192+
}
2193+
}
2194+
}

web_src/less/_repository.less

Lines changed: 0 additions & 15 deletions
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)