Files
web/packages/design-system/lib/components/Lightbox/Gallery/gallery.module.css
Matilda Landström fc857ad58f Merged in SW-2064-lightbox-updates (pull request #3347)
feat(SW-2064): Lightbox updates

* chore(SW-2064): add opacity to not selected images

* chore(SW-2064): set main image as the first image in thumbnail

* chore(SW-2064): disable navigation buttons on first and last image

* fix(SW-2064): use cx

* Revert "chore(SW-2064): disable navigation buttons on first and last image"

This reverts commit 9c5acd8a02b83740f35d1cfa88bfba6b006ba947.

* refactor(SW-2064): create ImageCounter component

* refactor(SW-2064)

* chore(SW-2064): add enter keu down on main image


Approved-by: Erik Tiekstra
2026-01-08 12:10:03 +00:00

186 lines
3.3 KiB
CSS

.gallery {
display: grid;
gap: var(--Space-x2);
padding: var(--Space-x2);
height: 100%;
overflow-y: auto;
background-color: var(--Background-Primary);
}
.mobileGallery {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--Space-x1);
padding-bottom: var(--Space-x3);
}
.thumbnailContainer {
position: relative;
height: 242px;
}
.thumbnail {
grid-column: 2 / span 5;
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: var(--Space-x15);
}
.fullWidthImage {
grid-column: 1 / -1;
height: 240px;
}
.imageButton {
position: relative;
height: 100%;
width: 100%;
padding: 0;
border-width: 0;
background-color: transparent;
cursor: pointer;
overflow: hidden;
z-index: 0;
border-radius: var(--Corner-radius-sm);
&:focus-visible {
outline: 2px solid var(--Border-Interactive-Focus);
outline-offset: 2px; /* Adjust the outline offset as wrappers uses overflow-hidden */
}
}
.image {
transition: opacity 0.3s ease-in-out;
object-fit: cover;
z-index: -1;
}
.notActiveImage {
opacity: 0.5;
}
.activeImage {
border: 2px solid var(--Border-Interactive-Active);
}
.imageCounter {
position: absolute;
bottom: var(--Space-x1);
left: 50%;
transform: translateX(-50%);
}
@media screen and (max-width: 767px) {
.closeButton .desktopCloseIcon,
.desktopGallery {
display: none;
}
.gallery {
align-content: start;
}
.closeButton {
justify-self: start;
}
}
@media screen and (min-width: 768px) {
.mobileGallery,
.closeButton .mobileCloseIcon {
display: none;
}
.gallery {
padding: var(--Space-x5) var(--Space-x6);
}
.closeButton {
position: absolute;
top: var(--Space-x2);
right: var(--Space-x2);
z-index: 1;
}
.desktopGallery {
display: grid;
grid-template-rows: 28px 1fr 130px;
row-gap: var(--Space-x15);
background-color: var(--Background-Primary);
height: 100%;
position: relative;
overflow: hidden;
}
.header {
display: flex;
justify-content: center;
}
.caption {
background-color: var(--Base-Surface-Subtle-Normal);
padding: var(--Space-x05) var(--Space-x1);
border-radius: var(--Corner-radius-sm);
color: var(--Text-Secondary);
}
.content {
position: relative;
width: 100%;
height: 100%;
}
.motionContainer {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
.mainImage {
object-fit: contain;
border-radius: var(--Corner-radius-sm);
/* Override Next.js Image styles, we can't set width/height on the image as we don't know the aspect ratio of the image */
width: auto !important;
height: auto !important;
position: relative !important;
max-width: 100%;
max-height: 100%;
cursor: pointer;
}
.desktopThumbnailGrid {
display: grid;
grid-template-columns: 0.2fr repeat(5, 1fr) 0.2fr;
gap: var(--Space-x15);
max-height: 7.8125rem;
}
.thumbnailContainer {
height: 125px;
}
.fullWidthImage {
grid-column: auto;
height: auto;
}
.thumbnailContainer img {
border-radius: var(--Corner-radius-sm);
}
.navigationButton {
position: absolute;
top: 50%;
transform: translateY(-50%);
&.previous {
left: var(--Space-x2);
}
&.next {
right: var(--Space-x2);
}
}
}