mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 02:37:13 -04:00
Introduce flex-list
& flex-item
elements for Gitea UI (#25790)
This PR introduces a new UI element type for Gitea called `flex-item`. It consists of a horizontal card with a leading, main and trailing part:  The idea behind it is that in Gitea UI, we have many cases where we use this kind of layout, but it is achieved in many different ways: - grid layout - `.ui.list` with additional hacky flexbox - `.ui.key.list` - looks to me like a style set originally created for ssh/gpg key list, was used in many other places - `.issue.list` - created for issue cards, used in many other places - ... This new style is based on `.issue.list`, specifically the refactoring of it done in #25750. In this PR, the new element is introduced and lots of templates are being refactored to use that style. This allows to remove a lot of page-specific css, makes many of the elements responsive or simply provides a cleaner/better-looking way to present information. A devtest section with the new style is also available. <details> <summary>Screenshots (left: before, right: after)</summary>                    </details> --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
fc6c3d626e
commit
b9baed2c74
46 changed files with 955 additions and 1020 deletions
|
@ -52,3 +52,18 @@
|
|||
background-color: var(--color-yellow);
|
||||
color: var(--color-white);
|
||||
}
|
||||
|
||||
.run-list-item-right {
|
||||
flex: 0 0 15%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
|
||||
.run-list-item-right .run-list-meta {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
gap: .25rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
|
|
@ -96,61 +96,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
.feeds .news li {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.feeds .news li img {
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.feeds .news li > * + * {
|
||||
margin-left: 0.35rem;
|
||||
}
|
||||
|
||||
.feeds .news > .ui.grid {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.feeds .news .left .ui.avatar {
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.feeds .news .time-since {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.feeds .news .issue.title {
|
||||
width: 80%;
|
||||
margin: 0 0 1em;
|
||||
}
|
||||
|
||||
.feeds .news .push.news .content ul {
|
||||
line-height: 18px;
|
||||
font-size: 13px;
|
||||
list-style: none;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.feeds .news .push.news .content ul .text.truncate {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.feeds .news .commit-id {
|
||||
.feeds .commit-id {
|
||||
font-family: var(--fonts-monospace);
|
||||
}
|
||||
|
||||
.feeds .news code {
|
||||
.feeds code {
|
||||
padding: 2px 4px;
|
||||
border-radius: 3px;
|
||||
background-color: var(--color-markup-code-block);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.feeds .news:last-of-type .divider {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
@ -10,33 +10,6 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.ui.repository.list .item {
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.ui.repository.list .item:not(:first-child) {
|
||||
border-top: 1px solid var(--color-secondary);
|
||||
padding-top: 1.5rem;
|
||||
}
|
||||
|
||||
.ui.repository.list .item .ui.header {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.ui.repository.list .item .ui.header .name {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.ui.repository.list .item .time {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ui.repository.list .repo-title .labels {
|
||||
word-break: normal;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ui.repository.branches .info {
|
||||
font-size: 12px;
|
||||
color: var(--color-text-light);
|
||||
|
@ -58,27 +31,3 @@
|
|||
.ui.repository.branches table .ui.popup {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ui.user.list .item {
|
||||
padding-bottom: 25px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ui.user.list .item:not(:first-child) {
|
||||
border-top: 1px solid var(--color-secondary);
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
.ui.user.list .item img.ui.avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ui.user.list .item .description {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.ui.user.list .item .description .svg:not(:first-child) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@import "./modules/svg.css";
|
||||
@import "./modules/flexcontainer.css";
|
||||
|
||||
@import "./shared/issuelist.css";
|
||||
@import "./shared/flex-list.css";
|
||||
@import "./shared/milestone.css";
|
||||
@import "./shared/repoorg.css";
|
||||
@import "./shared/settings.css";
|
||||
|
|
|
@ -133,7 +133,6 @@
|
|||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.organization.teams .members .ui.avatar,
|
||||
.organization.profile .members .ui.avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
|
@ -161,25 +160,6 @@
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.organization.members .list .item {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
border-bottom: 1px solid var(--color-secondary);
|
||||
}
|
||||
|
||||
.organization.members .list .item .ui.avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 1rem;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.organization.members .list .item .meta {
|
||||
line-height: 24px;
|
||||
word-break: break-word;
|
||||
min-width: 2em;
|
||||
}
|
||||
|
||||
.organization.teams .detail .item {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
@ -188,22 +168,6 @@
|
|||
border-bottom: 1px solid var(--color-secondary);
|
||||
}
|
||||
|
||||
.organization.teams .repositories .item,
|
||||
.organization.teams .members .item {
|
||||
padding: 10px 19px;
|
||||
}
|
||||
|
||||
.organization.teams .repositories .item:not(:last-child),
|
||||
.organization.teams .members .item:not(:last-child) {
|
||||
border-bottom: 1px solid var(--color-secondary);
|
||||
}
|
||||
|
||||
.organization.teams .repositories .item .button,
|
||||
.organization.teams .members .item .button {
|
||||
padding: 9px 10px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.org-team-navbar .active.item {
|
||||
background: var(--color-box-body) !important;
|
||||
}
|
||||
|
|
|
@ -584,15 +584,6 @@
|
|||
min-width: 100px;
|
||||
}
|
||||
|
||||
.repository.options .danger .item {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
.repository.options .danger .ui.divider {
|
||||
margin: 0;
|
||||
border-color: var(--color-error-border);
|
||||
}
|
||||
|
||||
.repository.new.issue .comment.form .comment .avatar {
|
||||
width: 3em;
|
||||
}
|
||||
|
@ -1927,15 +1918,6 @@
|
|||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration .collaborator.list {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration .collaborator.list > .item {
|
||||
margin: 0;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration #repo-collab-form #search-user-box .results {
|
||||
left: 7px;
|
||||
}
|
||||
|
@ -2389,15 +2371,6 @@
|
|||
padding: 10px 0 0;
|
||||
}
|
||||
|
||||
.settings .list.key .meta {
|
||||
padding-top: 5px;
|
||||
color: var(--color-text-light-2);
|
||||
}
|
||||
|
||||
.settings .list.collaborator > .item {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui.vertical.menu .header.item {
|
||||
font-size: 1.1em;
|
||||
background: var(--color-box-header);
|
||||
|
|
|
@ -32,3 +32,36 @@
|
|||
order: 2 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .branches {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .branches .branch {
|
||||
background-color: var(--color-secondary-alpha-40);
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .branches .truncated-name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 10em;
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .checklist progress {
|
||||
margin-left: 2px;
|
||||
width: 80px;
|
||||
height: 6px;
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .checklist progress::-webkit-progress-value {
|
||||
background-color: var(--color-secondary-dark-4);
|
||||
}
|
||||
|
||||
#issue-list .flex-item-body .checklist progress::-moz-progress-bar {
|
||||
background-color: var(--color-secondary-dark-4);
|
||||
}
|
94
web_src/css/shared/flex-list.css
Normal file
94
web_src/css/shared/flex-list.css
Normal file
|
@ -0,0 +1,94 @@
|
|||
.flex-list {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.flex-item:not(:last-child) {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.flex-item-baseline {
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.flex-item-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-leading {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.flex-item-header {
|
||||
display: flex;
|
||||
gap: .25rem;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.flex-item a:not(.label, .button):hover {
|
||||
color: var(--color-primary) !important;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-icon svg {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-trailing {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
flex-grow: 0;
|
||||
flex-wrap: wrap;
|
||||
justify-content: end;
|
||||
flex-shrink: 2;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-title {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: .25rem;
|
||||
max-width: 100%;
|
||||
color: var(--color-text);
|
||||
font-size: 16px;
|
||||
min-width: 0;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.flex-item .flex-item-title a {
|
||||
color: var(--color-text);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.flex-item .flex-item-body {
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: .25rem;
|
||||
color: var(--color-text-light-2);
|
||||
}
|
||||
|
||||
.flex-item .flex-item-body a {
|
||||
color: inherit;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.flex-list > .flex-item + .flex-item {
|
||||
border-top: 1px solid var(--color-secondary);
|
||||
padding-top: 8px;
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
.issue.list {
|
||||
list-style: none;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.issue.list .item {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.issue.list .item .issue-item-left {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.issue.list .item .issue-item-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.issue.list .item .issue-item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.issue.list a:not(.label):hover {
|
||||
color: var(--color-primary) !important;
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-icon svg {
|
||||
margin-right: 0.75rem;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.issue.list .item .issue-item-right {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.issue.list > .action-item {
|
||||
align-items: normal;
|
||||
}
|
||||
|
||||
.issue.list > .item .action-item-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 4px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
.issue.list > .item .action-item-right {
|
||||
flex: 0 0 15%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-title {
|
||||
max-width: 100%;
|
||||
color: var(--color-text);
|
||||
font-size: 16px;
|
||||
min-width: 0;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-title a.index {
|
||||
max-width: fit-content;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.issue.list > .item .title {
|
||||
color: var(--color-text);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-body {
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: .25rem;
|
||||
color: var(--color-text-light-2);
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-body a {
|
||||
color: inherit;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-body .checklist progress {
|
||||
margin-left: 2px;
|
||||
width: 80px;
|
||||
height: 6px;
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-body .checklist progress::-webkit-progress-value {
|
||||
background-color: var(--color-secondary-dark-4);
|
||||
}
|
||||
|
||||
.issue.list > .item .issue-item-body .checklist progress::-moz-progress-bar {
|
||||
background-color: var(--color-secondary-dark-4);
|
||||
}
|
||||
|
||||
.issue.list .branches {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.issue.list .branches .branch {
|
||||
background-color: var(--color-secondary-alpha-40);
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.issue.list .branches .truncated-name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 10em;
|
||||
}
|
||||
|
||||
.issue.list > .item + .item {
|
||||
border-top: 1px solid var(--color-secondary);
|
||||
}
|
|
@ -58,15 +58,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.user.profile .ui.repository.list {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.user.profile .ui.repository.list .repo-title .labels {
|
||||
word-break: normal;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.user.profile #loading-heatmap {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue