Skip to content

Commit b186767

Browse files
MMP0abidlabsgradio-pr-botdawoodkhan82
authored
Fix Gallery preview overlay and backdrop (#7505)
* Restore `Gallery` translucent background * Add `backdrop-filter` for Safari * Fix overflowing `Gallery` preview overlay * add changeset * Older browser support * add changeset --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com>
1 parent 9c36572 commit b186767

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.changeset/young-emus-find.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@gradio/app": patch
3+
"@gradio/gallery": patch
4+
"gradio": patch
5+
---
6+
7+
fix:Fix `Gallery` preview overlay and backdrop

js/app/src/Blocks.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@
867867
868868
.backdrop {
869869
flex: 1 1 0%;
870+
-webkit-backdrop-filter: blur(4px);
870871
backdrop-filter: blur(4px);
871872
}
872873

js/gallery/shared/Gallery.svelte

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,22 @@
338338
.preview {
339339
display: flex;
340340
position: absolute;
341-
top: 0px;
342-
right: 0px;
343-
bottom: 0px;
344-
left: 0px;
345341
flex-direction: column;
346342
z-index: var(--layer-2);
343+
border-radius: calc(var(--block-radius) - var(--block-border-width));
344+
-webkit-backdrop-filter: blur(8px);
347345
backdrop-filter: blur(8px);
346+
width: var(--size-full);
347+
height: var(--size-full);
348+
}
349+
350+
.preview::before {
351+
content: "";
352+
position: absolute;
353+
z-index: var(--layer-below);
348354
background: var(--background-fill-primary);
355+
opacity: 0.9;
356+
width: var(--size-full);
349357
height: var(--size-full);
350358
}
351359

0 commit comments

Comments
 (0)