-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SUL23-480: caption missing but really under the image #217
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -89,7 +89,7 @@ const StanfordNews = async ({node, ...props}: {node: NodeStanfordNews}) => { | |||
|
|||
{imageUrl && ( | |||
<figure className="relative mx-auto mb-100 aspect-[16/9] lg:w-10/12"> | |||
<Image className="object-cover" src={buildUrl(imageUrl).toString()} alt={imageAlt || ""} fill /> | |||
<Image className="!relative object-cover" src={buildUrl(imageUrl).toString()} alt={imageAlt || ""} fill /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest staying away from !important
uses, especially on the image component. NextJS Image component applies it's own styles that make it function the way it does for responsive sizes. My suggestion is to adjust the wrapper a little bit.:
<figure className="table">
<span className="relative aspect-[16/9]">
<Image .../>
</span>
<figcaption className="table-caption">...</figcaption>
</figure>
The <Image>
component needs the immediate parent to be relative positioned. So changing this markup keeps that relative positioning but takes the caption out of it so the caption can be its own thing. You'll also notice the table classes. This can help with the positioning of the caption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. That's a good idea with the table
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pookmish I used caption
instead of table-caption
because of how it displays with a table.
<figure className="relative mx-auto mb-100 aspect-[16/9] lg:w-10/12"> | ||
<Image className="object-cover" src={buildUrl(imageUrl).toString()} alt={imageAlt || ""} fill /> | ||
|
||
<figure className="mb-100 table"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<figure className="mb-100 table"> | |
<figure className="mb-100 table w-full"> |
<figure className="mb-100 table"> | ||
<span className="relative mx-auto block aspect-[16/9] lg:w-10/12"> | ||
<Image className="object-cover" src={buildUrl(imageUrl).toString()} alt={imageAlt || ""} fill /> | ||
</span> | ||
{node.suNewsBannerMediaCaption && ( | ||
<figcaption className="caption text-center">{node.suNewsBannerMediaCaption}</figcaption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<figcaption className="caption text-center">{node.suNewsBannerMediaCaption}</figcaption> | |
<figcaption className="table-caption caption-bottom text-center">{node.suNewsBannerMediaCaption}</figcaption> |
{node.suNewsBannerMediaCaption && ( | ||
<figcaption className="caption text-center">{node.suNewsBannerMediaCaption}</figcaption> | ||
)} | ||
</figure> | ||
)} | ||
|
||
{node.suNewsBanner?.__typename === "MediaVideo" && ( | ||
<figure className="relative mx-auto mb-100 aspect-[16/9] w-10/12"> | ||
<Oembed url={node.suNewsBanner.mediaOembedVideo} /> | ||
<figure className="mb-100 table"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<figure className="mb-100 table"> | |
<figure className="mb-100 table w-full"> |
<figure className="mb-100 table"> | ||
<span className="relative mx-auto block aspect-[16/9] w-10/12"> | ||
<Oembed url={node.suNewsBanner.mediaOembedVideo} /> | ||
</span> | ||
{node.suNewsBannerMediaCaption && ( | ||
<figcaption className="caption text-center">{node.suNewsBannerMediaCaption}</figcaption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<figcaption className="caption text-center">{node.suNewsBannerMediaCaption}</figcaption> | |
<figcaption className="table-caption caption-bottom text-center">{node.suNewsBannerMediaCaption}</figcaption> |
* SUL23-620: Corrected shared tags events view contextual filter argument name * SUL23-593: Show list paragraph empty message if no results * Add Image credit field on media image * SUL23-480: caption missing but really under the image (#217) * Removed the absolute * fixup to table * fixup * Updated dependencies * SUL23-481 | hardcode h3 headings for feature collections (#218) * SUL23-481 | hardcode headings for feature collections * adjust heading level for collections * Improved invalidation when comparing the home page path * Updated version in package.json --------- Co-authored-by: Mike Decker <[email protected]> Co-authored-by: Jen Breese <[email protected]> Co-authored-by: Rebecca Hong <[email protected]>
* SUL23-620: Corrected shared tags events view contextual filter argument name * SUL23-593: Show list paragraph empty message if no results * Add Image credit field on media image * SUL23-480: caption missing but really under the image (#217) * Removed the absolute * fixup to table * fixup * Updated dependencies * SUL23-481 | hardcode h3 headings for feature collections (#218) * SUL23-481 | hardcode headings for feature collections * adjust heading level for collections * Improved invalidation when comparing the home page path --------- Co-authored-by: Mike Decker <[email protected]> Co-authored-by: Jen Breese <[email protected]> Co-authored-by: Rebecca Hong <[email protected]>
READY FOR REVIEW
Summary
Review By (Date)
Criticality
Urgency
Review Tasks
Setup tasks and/or behavior to test
Site Configuration Sync
Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
- SUL23-480
Resources