philomena/assets/css/elements/media.css

175 lines
3.4 KiB
CSS
Raw Permalink Normal View History

2023-11-23 17:07:49 +01:00
.image-constrained {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
2023-11-23 17:07:49 +01:00
}
.media-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--media-container-width), 1fr));
grid-auto-rows: 1fr;
grid-gap: var(--padding-small);
}
2024-05-20 21:25:43 +02:00
.media-list:before {
2024-05-20 22:30:41 +02:00
content: "";
2023-11-23 17:07:49 +01:00
width: 0;
padding-bottom: calc(100% + var(--media-header-height));
grid-row: 1 / 1;
grid-column: 1 / 1;
}
@mixin if-phone {
2023-11-23 17:07:49 +01:00
.media-list {
grid-template-columns: repeat(auto-fill, minmax(var(--media-small-container-width), 1fr));
}
}
.media-box {
background: var(--background-color);
border: 1px solid var(--secondary-muted-color);
border-radius: var(--border-radius-inner);
overflow: hidden;
}
.media-box:first-child {
grid-row: 1 / 1;
grid-column: 1 / 1;
}
.media-box__header {
display: flex;
line-height: var(--media-header-height);
padding: 0 var(--padding-small);
justify-content: center;
font-size: var(--font-tiny-size);
}
.media-box__header--link-row {
display: grid;
grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
text-align: center;
width: fit-content;
}
.media-box__content {
width: 100%;
padding-top: 100%;
position: relative;
border-radius: 0 0 var(--border-radius-inner) var(--border-radius-inner);
overflow: hidden;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-05-20 21:25:43 +02:00
.media-box__image {
max-width: 100%;
height: auto;
2023-11-23 17:07:49 +01:00
}
2024-04-30 20:38:28 +02:00
.media-box__content--featured .media-box__image {
max-height: var(--media-featured-width);
2023-11-23 17:07:49 +01:00
}
.media-box__overlay {
display: block;
position: absolute;
z-index: 4;
min-width: 95%;
text-align: left;
font-weight: bold;
word-wrap: break-word;
color: var(--text-color);
background: var(--primary-color);
padding: 0 var(--padding-normal);
line-height: var(--media-header-height);
pointer-events: none;
top: 0;
}
.media-box__overlay:nth-child(2) {
top: var(--media-header-height);
}
2024-05-20 22:30:41 +02:00
.post-image-container,
.post-image-container img {
2024-05-20 21:25:43 +02:00
width: var(--media-tiny-container-width);
height: var(--media-tiny-container-width);
}
2024-05-20 22:30:41 +02:00
.media-tiny-container,
.media-tiny-container img {
2024-05-20 21:25:43 +02:00
width: var(--media-tiny-container-width);
height: var(--media-tiny-container-width);
}
2024-05-20 22:30:41 +02:00
.thumb-tiny,
.thumb-tiny img {
2024-05-20 21:25:43 +02:00
max-width: var(--media-tiny-container-width);
max-height: var(--media-tiny-container-width);
}
2023-11-23 17:07:49 +01:00
.image-container {
display: flex;
2024-07-02 20:09:30 +02:00
position: relative;
flex-direction: column;
align-items: center;
justify-content: center;
2023-11-23 17:07:49 +01:00
}
.image-container a {
display: flex;
max-height: 100%;
2024-05-20 19:04:12 +02:00
width: 100%;
height: auto;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-04-30 20:38:28 +02:00
/* For some reason tall images don't center properly within the container
without this hack. I blame CSS. */
2024-05-20 21:25:43 +02:00
2024-05-20 19:04:12 +02:00
.image-container a img {
2024-04-30 20:38:28 +02:00
max-height: 100%;
margin: auto;
2023-11-23 17:07:49 +01:00
}
2024-05-20 19:04:12 +02:00
.image-container picture {
display: inline-flex;
justify-content: center;
align-self: center;
width: 100%;
height: 100%;
}
2024-05-20 21:25:43 +02:00
.media-box__content .image-container {
position: absolute;
inset: 0;
}
2024-05-20 19:04:12 +02:00
.media__standalone {
position: relative;
}
2024-05-20 21:25:43 +02:00
.thumb-tiny .media-box__overlay {
2024-05-20 19:04:12 +02:00
width: 100%;
max-width: 100%;
padding: 0 var(--padding-tiny);
line-height: var(--media-small-header-height);
font-size: var(--font-micro-size);
}
2023-11-23 17:07:49 +01:00
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;
grid-gap: var(--padding-small);
}
.image-scaled {
max-width: 100%;
}
2024-06-12 20:50:46 +02:00
@mixin if-phone {
.media-box__header--link-row {
grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
}
}