Skip to content

Commit 041b40d

Browse files
committed
more specific classes
1 parent 2e98bdc commit 041b40d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

app/globals.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,20 @@ body {
222222
}
223223
}
224224

225-
[data-state="open"] {
225+
/* Target only image lightbox dialog content */
226+
.image-lightbox-content[data-state="open"] {
226227
animation: dialog-content-show 200ms cubic-bezier(0.16, 1, 0.3, 1);
227228
}
228229

229-
[data-state="closed"] {
230+
.image-lightbox-content[data-state="closed"] {
230231
animation: dialog-content-hide 200ms cubic-bezier(0.16, 1, 0.3, 1);
231232
}
232233

233-
.dialog-overlay[data-state="open"] {
234+
/* Target only image lightbox dialog overlay */
235+
.image-lightbox-overlay[data-state="open"] {
234236
animation: dialog-overlay-show 200ms cubic-bezier(0.16, 1, 0.3, 1);
235237
}
236238

237-
.dialog-overlay[data-state="closed"] {
239+
.image-lightbox-overlay[data-state="closed"] {
238240
animation: dialog-overlay-hide 200ms cubic-bezier(0.16, 1, 0.3, 1);
239241
}

src/components/imageLightbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export function ImageLightbox({src, alt, width, height, children}: ImageLightbox
2525
</Dialog.Trigger>
2626

2727
<Dialog.Portal>
28-
<Dialog.Overlay className="dialog-overlay fixed inset-0 bg-black/80 backdrop-blur-sm z-50" />
28+
<Dialog.Overlay className="image-lightbox-overlay fixed inset-0 bg-black/80 backdrop-blur-sm z-50" />
2929

30-
<Dialog.Content className="fixed left-[50%] top-[50%] z-50 max-h-[90vh] max-w-[90vw] translate-x-[-50%] translate-y-[-50%]">
30+
<Dialog.Content className="image-lightbox-content fixed left-[50%] top-[50%] z-50 max-h-[90vh] max-w-[90vw] translate-x-[-50%] translate-y-[-50%]">
3131
{/* Close button */}
3232
<Dialog.Close className="absolute right-4 top-4 z-10 rounded-sm bg-black/50 p-2 text-white opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2">
3333
<X className="h-4 w-4" />

0 commit comments

Comments
 (0)