Skip to content

Commit

Permalink
Use horizontal tabs for repo header on mobile (go-gitea#19468)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Gusted authored and AbdulrhmnGhanem committed Aug 23, 2022
1 parent 9bf664d commit 546cbba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
</div><!-- end grid -->
</div><!-- end container -->
{{end}}
<div class="ui tabs container">
<div class="ui tabs container repo-header-container">
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
<div class="ui tabular stackable menu navbar">
{{if .Permission.CanRead $.UnitTypeCode}}
Expand Down
25 changes: 25 additions & 0 deletions web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -2956,11 +2956,21 @@ tbody.commit-list {
justify-content: space-between;
flex-wrap: wrap;
word-break: break-word;

@media @mediaSm {
+ .container {
margin-top: 7px;
}
}
}

.repo-buttons {
display: flex;
align-items: center;

@media @mediaSm {
margin-top: 1em;
}
}

.repo-buttons .ui.labeled.button > .label:hover {
Expand Down Expand Up @@ -3227,3 +3237,18 @@ td.blob-excerpt {
transform: scale(105%);
box-shadow: 0 .5rem 1rem var(--color-shadow) !important;
}

@media @mediaSm {
.repo-header-container {
overflow-x: auto;
overflow-y: hidden;

.ui.stackable.menu {
flex-direction: row;

.item {
width: initial !important;
}
}
}
}

0 comments on commit 546cbba

Please sign in to comment.