Skip to content

Commit 7c1eec3

Browse files
committed
fix(go-gitea#31667): fixes images in cards overflowing Projects columns
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 .
1 parent bbd1476 commit 7c1eec3

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

web_src/css/features/projects.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
.project-column .issue-card {
2626
color: var(--color-text);
27+
align-items: stretch;
2728
}
2829

2930
.project-column-header {
@@ -41,7 +42,7 @@
4142
flex: 1;
4243
}
4344

44-
.project-column > .cards {
45+
.project-column>.cards {
4546
flex: 1;
4647
display: flex;
4748
align-content: baseline;
@@ -53,7 +54,7 @@
5354
gap: .25rem;
5455
}
5556

56-
.project-column > .divider {
57+
.project-column>.divider {
5758
margin: 5px 0;
5859
border-color: currentcolor;
5960
opacity: .5;
@@ -70,15 +71,20 @@
7071
.card-attachment-images {
7172
display: inline-block;
7273
white-space: nowrap;
73-
overflow: hidden;
74+
overflow: scroll;
75+
cursor: default;
76+
scroll-snap-type: x mandatory;
7477
text-align: center;
7578
}
7679

7780
.card-attachment-images img {
7881
display: inline-block;
7982
max-height: 50px;
8083
border-radius: var(--border-radius);
84+
text-align: left;
85+
scroll-snap-align: center;
8186
margin-right: 2px;
87+
aspect-ratio: 1;
8288
}
8389

8490
.card-attachment-images img:only-child {
@@ -94,4 +100,4 @@
94100

95101
.card-ghost * {
96102
opacity: 0;
97-
}
103+
}

web_src/css/repo/issue-card.css

Lines changed: 2 additions & 2 deletions
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);
@@ -37,4 +37,4 @@
3737
gap: 0.25em;
3838
justify-content: end;
3939
flex-wrap: wrap;
40-
}
40+
}

0 commit comments

Comments
 (0)