2023-06-08 02:15:57 +08:00
|
|
|
.d-image-grid:not([data-disabled]) {
|
|
|
|
$grid-column-gap: 6px;
|
|
|
|
|
|
|
|
&[data-columns] {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[data-columns="2"] > * {
|
|
|
|
flex-basis: calc(50% - ($grid-column-gap / 2));
|
|
|
|
margin-right: $grid-column-gap;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[data-columns="3"] > * {
|
|
|
|
flex-basis: calc(33.33% - ($grid-column-gap * 0.667));
|
|
|
|
margin-right: $grid-column-gap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.d-image-grid-column {
|
|
|
|
box-sizing: border-box;
|
2023-06-13 21:25:46 +08:00
|
|
|
// use flex layout, flex-grow and object-fit: cover
|
|
|
|
// to better have the images fill their containers
|
|
|
|
// and line up vertically (it's not perfect!)
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
> div,
|
|
|
|
> span {
|
|
|
|
flex-grow: 1;
|
|
|
|
overflow: hidden;
|
|
|
|
// hardcoded max-height here prevents extra tall images
|
|
|
|
// from having an outsized effect on the grid
|
|
|
|
max-height: 1200px;
|
|
|
|
|
|
|
|
img:not(.thumbnail):not(.ytp-thumbnail-image):not(.emoji) {
|
|
|
|
height: 100%;
|
|
|
|
object-fit: cover;
|
|
|
|
}
|
|
|
|
}
|
2023-06-08 02:15:57 +08:00
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
|
2023-06-10 03:28:50 +08:00
|
|
|
> img,
|
|
|
|
> div {
|
2023-06-08 02:15:57 +08:00
|
|
|
margin-bottom: $grid-column-gap;
|
|
|
|
}
|
|
|
|
|
2023-06-13 21:25:46 +08:00
|
|
|
// Forces images in the grid to fill each column width-wise
|
2023-06-08 02:15:57 +08:00
|
|
|
img,
|
|
|
|
> .lightbox-wrapper,
|
|
|
|
> .lightbox-wrapper > .lightbox {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.lightbox-wrapper {
|
|
|
|
.meta .informations {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.meta .filename {
|
|
|
|
flex-grow: 3;
|
|
|
|
}
|
2023-06-13 21:25:46 +08:00
|
|
|
// full-height lightbox element in container
|
|
|
|
> .lightbox {
|
|
|
|
height: 100%;
|
|
|
|
}
|
2023-06-08 02:15:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// when staging edits
|
|
|
|
.image-wrapper {
|
|
|
|
display: block;
|
2023-06-13 21:25:46 +08:00
|
|
|
margin-bottom: $grid-column-gap;
|
|
|
|
padding-bottom: 0em;
|
2023-06-08 02:15:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-13 21:25:46 +08:00
|
|
|
.d-editor-preview & {
|
2023-06-08 02:15:57 +08:00
|
|
|
.image-wrapper {
|
2023-06-13 21:25:46 +08:00
|
|
|
margin-bottom: $grid-column-gap;
|
|
|
|
padding-bottom: 0em;
|
2023-06-08 02:15:57 +08:00
|
|
|
.button-wrapper {
|
|
|
|
.scale-btn-container,
|
|
|
|
&[editing] .wrap-image-grid-button {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-13 21:25:46 +08:00
|
|
|
|
|
|
|
.mobile-view .d-editor-preview & {
|
|
|
|
.image-wrapper {
|
|
|
|
.button-wrapper {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
&:hover .button-wrapper {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-08 02:15:57 +08:00
|
|
|
}
|