mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Work around Chrome image bug causing CLS
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
height={thumb?.originalHeight}
|
height={thumb?.originalHeight}
|
||||||
style:background-image={loaded ? "none" : `url('${thumb?.thumbSrc}')`}
|
style:background-image={loaded ? "none" : `url('${thumb?.thumbSrc}')`}
|
||||||
on:load={() => loaded = true}
|
on:load={() => loaded = true}
|
||||||
|
style:--aspect-ratio={thumb?.originalWidth / thumb?.originalHeight}
|
||||||
/>
|
/>
|
||||||
{#if title}
|
{#if title}
|
||||||
<figcaption>{title}</figcaption>
|
<figcaption>{title}</figcaption>
|
||||||
@@ -42,12 +43,12 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
img {
|
img {
|
||||||
max-height: 60vh;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
display: block;
|
display: block;
|
||||||
margin-inline: auto;
|
margin-inline: auto;
|
||||||
|
max-width: calc(min(100%, 60vh * var(--aspect-ratio)));
|
||||||
}
|
}
|
||||||
figure {
|
figure {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -115,10 +115,13 @@ body {
|
|||||||
iframe,
|
iframe,
|
||||||
img,
|
img,
|
||||||
svg {
|
svg {
|
||||||
max-block-size: 100%;
|
/* max-block-size: 100%;
|
||||||
max-inline-size: 100%;
|
max-inline-size: 100%;
|
||||||
inline-size: auto;
|
inline-size: auto;
|
||||||
block-size: auto;
|
block-size: auto; */
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user