1
0
Fork 0
forked from forgejo/forgejo

Rework repo buttons (#20602, #20718) (#20719)

* Rework repo buttons (#20602)

* Rework repo buttons

- Replace "New PR" and "Go to File" button with Icon Button
- Move all "Add File" actions into a dropdown button
- Remove most custom styling of clone buttons
- Margin and wiki tweaks

Buttons are now all equal height, mobile layout wraps gracefully.

Fixes: https://github.com/go-gitea/gitea/issues/13671
Replaces: https://github.com/go-gitea/gitea/pull/20375

* Restore history button and hide add button when unable to add (#20718)

Fix two regressions from #20602:

- Restore the 'History' button that was previously unable to render
  because it's show condition was never hit
- Hide the 'Add File' button when there would be no items in the
  dropdown.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind 2022-08-20 16:49:16 +02:00 committed by GitHub
parent b88a4b4854
commit c61ed6fad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 122 additions and 141 deletions

View file

@ -67,22 +67,6 @@
min-width: 40% !important;
}
#file-buttons {
/* The reason for the !important is that Semantic itself has
margin-left: 0 !important on right items on mobile, which is mostly
to make sure elements which on menus would otherwise be on the right
align correctly with other elements when stacked.
Unfortunately, this brings some weird alignment on this particular
element, so we need to override it. */
margin-left: auto !important;
font-weight: normal;
.ui.button {
padding: 8px 10px;
font-weight: normal;
}
}
.unicode-escaped .escaped-code-point {
&[data-escaped]::before {
visibility: visible;
@ -223,22 +207,15 @@
}
#clone-panel {
width: 350px;
#repo-clone-url {
width: 320px;
@media @mediaSm {
width: 100%;
}
input {
border-radius: 0;
padding: 5px 10px;
width: 50%;
line-height: 1.4;
}
.clone.button {
font-size: 13px;
padding: 7.5px 5px;
@media @mediaMd {
width: 200px;
}
@media @mediaSm {
width: 200px;
}
}
#repo-clone-https,
@ -258,10 +235,6 @@
border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
}
.icon.button {
padding: 0 10px;
}
.dropdown .menu {
right: 0 !important;
left: auto !important;
@ -293,25 +266,6 @@
}
}
#file-buttons {
font-weight: normal;
.ui.button {
padding: 8px 10px;
font-weight: normal;
}
.ui.tiny.primary.buttons {
@media @mediaSm {
width: 100%;
}
}
.button + .button {
border-left: none;
}
}
#repo-files-table {
thead {
th {
@ -2108,10 +2062,6 @@
}
&.view {
.choose.page {
margin-top: -5px;
}
> .markup {
padding: 15px 30px;
@ -2138,6 +2088,12 @@
margin-bottom: 2px;
}
}
@media @mediaSm {
#clone-panel #repo-clone-url {
width: 160px;
}
}
}
&.settings {
@ -2828,6 +2784,31 @@
line-height: 1.3em; // there is a `font-size: 1.25em` for inside emoji, so here the line-height needs to be larger slightly
}
.repo-button-row {
margin-bottom: 10px;
}
.repo-button-row > * {
margin-top: 10px;
}
.wiki .repo-button-row {
margin-bottom: 0;
}
.wiki .repo-button-row > * {
margin-top: 0;
}
.repo-button-row .button {
padding: 6px 10px !important;
height: 30px;
}
.repo-button-row input {
height: 30px;
}
tbody.commit-list {
vertical-align: baseline;
}
@ -2905,20 +2886,6 @@ tbody.commit-list {
text-align: left;
}
@media @mediaSm {
.ui.stackable.menu {
&.mobile--margin-between-items > .item {
margin-top: 5px;
margin-bottom: 5px;
}
&.mobile--no-negative-margins {
margin-left: 0;
margin-right: 0;
}
}
}
#topic_edit {
margin-top: 5px;
}
@ -3442,3 +3409,15 @@ td.blob-excerpt {
}
}
}
.branch-dropdown-button {
max-width: 340px;
vertical-align: bottom !important;
@media @mediaMd {
max-width: 185px;
}
@media @mediaSm {
max-width: 165px;
}
}

View file

@ -17,6 +17,7 @@
.vm { vertical-align: middle !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.br-0 { border-radius: 0 !important; }
.mono {
font-family: var(--fonts-monospace) !important;