style image attribution
This commit is contained in:
@ -16,8 +16,12 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
>div {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
@ -13,8 +13,10 @@ export function ImageFigure(props: ImageProps) {
|
|||||||
<figure
|
<figure
|
||||||
className={`${styles.image} ${imageFormat ? styles[imageFormat] : ""}`}
|
className={`${styles.image} ${imageFormat ? styles[imageFormat] : ""}`}
|
||||||
>
|
>
|
||||||
|
<div className={styles.imageWrapper}>
|
||||||
<NextImage {...nextImageProps} />
|
<NextImage {...nextImageProps} />
|
||||||
{attribution && <div className={styles.attribution}>{attribution}</div>}
|
{attribution && <div className={styles.attribution}>{attribution}</div>}
|
||||||
|
</div>
|
||||||
{caption && <figcaption>{caption}</figcaption>}
|
{caption && <figcaption>{caption}</figcaption>}
|
||||||
</figure>
|
</figure>
|
||||||
);
|
);
|
||||||
|
@ -2,6 +2,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
|
.imageWrapper {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@ -22,7 +29,7 @@
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
margin: 2rem calc(var(--spacing-sitepadding-inline)*-1);
|
margin: 2rem calc(var(--spacing-sitepadding-inline)*-1);
|
||||||
|
|
||||||
img {
|
.imageWrapper, img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +41,7 @@
|
|||||||
&.fullwidth {
|
&.fullwidth {
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
|
|
||||||
img {
|
.imageWrapper, img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -44,10 +51,6 @@
|
|||||||
margin: 2rem auto;
|
margin: 2rem auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
img {
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
figcaption {
|
figcaption {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@ -55,5 +58,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.attribution {
|
.attribution {
|
||||||
border: 1px dotted mediumpurple;
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
display: inline-block;
|
||||||
|
padding: .1rem .2rem;
|
||||||
|
font-size: .6rem;
|
||||||
|
background: var(--color-black);
|
||||||
|
color: var(--color-betongGray);
|
||||||
|
opacity: .4;
|
||||||
}
|
}
|
Reference in New Issue
Block a user