]> source.dussan.org Git - gitea.git/commitdiff
Scroll images in project issues separately from the remaining issue (#31683) (#31823)
authorGiteabot <teabot@gitea.io>
Tue, 13 Aug 2024 02:43:48 +0000 (10:43 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Aug 2024 02:43:48 +0000 (10:43 +0800)
Backport #31683 by @SimonPistache

As discussed in #31667 & #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 #31667 is open to discussion as there should be room for
improvement.

Co-authored-by: Simon Priet <105607989+SimonPistache@users.noreply.github.com>
web_src/css/features/projects.css
web_src/css/repo/issue-card.css

index 74e8222a342ad27627be265431b9dd164a8ce630..0434e40c9f5dbf9f3be2abef5df61da81813770b 100644 (file)
@@ -70,7 +70,9 @@
 .card-attachment-images {
   display: inline-block;
   white-space: nowrap;
-  overflow: hidden;
+  overflow: scroll;
+  cursor: default;
+  scroll-snap-type: x mandatory;
   text-align: center;
 }
 
   display: inline-block;
   max-height: 50px;
   border-radius: var(--border-radius);
+  text-align: left;
+  scroll-snap-align: center;
   margin-right: 2px;
+  aspect-ratio: 1;
 }
 
 .card-attachment-images img:only-child {
index 390bfb6a01419808e514d92052dbd1219d3048cd..fb832bd05ab0f7bbd9bf46c239a78f5cb155c790 100644 (file)
@@ -2,7 +2,7 @@
   display: flex;
   flex-direction: column;
   gap: 4px;
-  align-items: start;
+  align-items: stretch;
   border-radius: var(--border-radius);
   padding: 8px 10px;
   border: 1px solid var(--color-secondary);