fix photoswipe layout issues (chrome)

This commit is contained in:
tobi 2025-04-14 13:01:47 +02:00
commit 94039ad3ef
6 changed files with 44 additions and 62 deletions

View file

@ -113,9 +113,6 @@ html, body {
.status .media .media-wrapper { .status .media .media-wrapper {
background: var(--bg-nearly-opaque); background: var(--bg-nearly-opaque);
} }
.status .media .media-wrapper details .unknown-attachment .placeholder {
border: 0.2rem dashed var(--magenta);
}
/* Polls */ /* Polls */
.status .text .poll { .status .text .poll {

View file

@ -134,7 +134,6 @@ html, body {
} }
.status .media .media-wrapper details .unknown-attachment .placeholder { .status .media .media-wrapper details .unknown-attachment .placeholder {
color: var(--base1); color: var(--base1);
border: 0.2rem dashed var(--base1);
} }
.status .media .media-wrapper details video.plyr-video { .status .media .media-wrapper details video.plyr-video {
background: transparent; background: transparent;

View file

@ -124,7 +124,6 @@ html, body {
} }
.status .media .media-wrapper details .unknown-attachment .placeholder { .status .media .media-wrapper details .unknown-attachment .placeholder {
color: var(--base1); color: var(--base1);
border: 0.2rem dashed var(--base1);
} }
.status .media .media-wrapper details video.plyr-video { .status .media .media-wrapper details video.plyr-video {
background: transparent; background: transparent;

View file

@ -80,7 +80,7 @@ $profile-bg: $gray4;
$button-bg: $blue2; $button-bg: $blue2;
$button-fg: $gray1; $button-fg: $gray1;
$button-hover-bg: $blue3; $button-hover-bg: $blue3;
$button-focus-border: $blue3; $button-focus-border: $button-hover-bg;
$button-danger-bg: $error3; $button-danger-bg: $error3;
$button-danger-fg: $white1; $button-danger-fg: $white1;

View file

@ -38,7 +38,7 @@
} }
details { details {
position: absolute; position: relative;
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -55,35 +55,6 @@
object-fit: cover; object-fit: cover;
} }
&[open] summary {
height: auto;
width: auto;
margin: 1rem;
padding: 0;
.show {
display: none;
}
.eye.button .hide {
display: inline-block;
grid-column: 1 / span 3;
grid-row: 1 / span 2;
}
div.blurhash-container > canvas {
display: none;
}
/*
Hide focus outline on click
to avoid ugly artifacts.
*/
&:focus {
outline: none;
}
}
summary { summary {
position: absolute; position: absolute;
height: 100%; height: 100%;
@ -110,6 +81,14 @@
margin: 0; margin: 0;
padding: 0.4rem; padding: 0.4rem;
/*
Make button outline really thick as we can't
know whether media has good contrast with it.
*/
&:focus-visible {
outline: 0.5rem dashed $button-focus-border;
}
.fa-fw { .fa-fw {
line-height: $fa-fw; line-height: $fa-fw;
} }
@ -117,16 +96,6 @@
.hide { .hide {
display: none; display: none;
} }
&:focus-visible {
/*
Can't rely on media having background with
decent contrast so inset and use button-fg
instead so focus is definitely visible.
*/
outline: 0.25rem dashed $button-fg;
outline-offset: -0.25rem;
}
} }
.show.sensitive { .show.sensitive {
@ -144,18 +113,42 @@
} }
} }
a.photoswipe-slide { &[open] summary {
display: inline-block; height: auto;
height: 100%; width: auto;
cursor: pointer;
grid-template-columns: 1fr;
grid-template-rows: 1fr;
.show {
display: none;
}
.eye.button .hide {
display: inline-block;
}
div.blurhash-container,
div.blurhash-container > canvas {
display: none;
}
}
a.photoswipe-slide,
a.unknown-attachment {
position: absolute;
width: 100%; width: 100%;
height: 100%;
/* /*
Inset outline to avoid outline Make link outline really thick as we can't
being hidden by overflow: hidden. know whether media has good contrast with it.
Indent outline to avoid being hidden by overflow: hidden.
*/ */
&:focus-visible { &:focus-visible {
outline: $button-focus-outline; outline: 0.5rem dotted $link-fg;
outline-offset: -0.25rem; outline-offset: -0.5rem;
} }
} }
@ -173,7 +166,6 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0.8rem; padding: 0.8rem;
border: 0.2rem dashed $white2;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -220,17 +212,13 @@
> span.eye.button { > span.eye.button {
font-size: smaller; font-size: smaller;
padding: 0 0.2rem 0 0.2rem; padding: 0.2rem;
> .fa-fw { > .fa-fw {
line-height: 1.4rem; line-height: 1.4rem;
} }
} }
} }
&[open] > summary {
margin: 0.5rem;
}
} }
} }
@ -248,7 +236,7 @@
> span.eye.button { > span.eye.button {
font-size: small; font-size: small;
padding: 0 0.1rem 0 0.1rem; padding: 0.1rem;
> .fa-fw { > .fa-fw {
line-height: 1.2rem; line-height: 1.2rem;

View file

@ -20,7 +20,6 @@
@import "./_media-wrapper.css"; @import "./_media-wrapper.css";
.media { .media {
grid-column: span 3;
display: grid; display: grid;
grid-template-columns: 50% 50%; grid-template-columns: 50% 50%;
grid-auto-rows: 10rem; grid-auto-rows: 10rem;