Skip to content

Commit fe7c941

Browse files
Scroll images in project issues separately from the remaining issue (go-gitea#31683)
As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains images, they can overflow the card on its containing column. This aims to fix this issue via snapping scrollbars. --- Issue go-gitea#31667 is open to discussion as there should be room for improvement.
1 parent 8883d99 commit fe7c941

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

web_src/css/features/projects.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,20 @@
7070
.card-attachment-images {
7171
display: inline-block;
7272
white-space: nowrap;
73-
overflow: hidden;
73+
overflow: scroll;
74+
cursor: default;
75+
scroll-snap-type: x mandatory;
7476
text-align: center;
7577
}
7678

7779
.card-attachment-images img {
7880
display: inline-block;
7981
max-height: 50px;
8082
border-radius: var(--border-radius);
83+
text-align: left;
84+
scroll-snap-align: center;
8185
margin-right: 2px;
86+
aspect-ratio: 1;
8287
}
8388

8489
.card-attachment-images img:only-child {

web_src/css/repo/issue-card.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
display: flex;
33
flex-direction: column;
44
gap: 4px;
5-
align-items: start;
5+
align-items: stretch;
66
border-radius: var(--border-radius);
77
padding: 8px 10px;
88
border: 1px solid var(--color-secondary);

0 commit comments

Comments
 (0)