Skip to content

Commit 1f05417

Browse files
author
Gusted
authored
Use horizontal tabs for repo header on mobile (#19468)
* Use horizontal tabs for repo header on mobile - The current behavior of the repo header on mobile is to display them vertically column-by-column. I've only experience annoyance due to this while trying to visit gitea instanced on mobile. This commit changes this behavior to use horizontal tabs, it uses less tabs and doesn't bloat 60% of your mobile screen with the repo headers. - A small fix added in this commit is to give some space around the repo buttons, current behavior is that they are too "close" to the repo title. * Fix lint
1 parent 9550e5a commit 1f05417

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

templates/repo/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
</div><!-- end grid -->
145145
</div><!-- end container -->
146146
{{end}}
147-
<div class="ui tabs container">
147+
<div class="ui tabs container repo-header-container">
148148
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
149149
<div class="ui tabular stackable menu navbar">
150150
{{if .Permission.CanRead $.UnitTypeCode}}

web_src/less/_repository.less

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,11 +2956,21 @@ tbody.commit-list {
29562956
justify-content: space-between;
29572957
flex-wrap: wrap;
29582958
word-break: break-word;
2959+
2960+
@media @mediaSm {
2961+
+ .container {
2962+
margin-top: 7px;
2963+
}
2964+
}
29592965
}
29602966

29612967
.repo-buttons {
29622968
display: flex;
29632969
align-items: center;
2970+
2971+
@media @mediaSm {
2972+
margin-top: 1em;
2973+
}
29642974
}
29652975

29662976
.repo-buttons .ui.labeled.button > .label:hover {
@@ -3227,3 +3237,18 @@ td.blob-excerpt {
32273237
transform: scale(105%);
32283238
box-shadow: 0 .5rem 1rem var(--color-shadow) !important;
32293239
}
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)