Skip to content

Improve Project Card Cover Image Handling#24

Merged
AJaccP merged 8 commits into
mainfrom
9-improve-project-card-cover-image-handling
Jul 26, 2026
Merged

Improve Project Card Cover Image Handling#24
AJaccP merged 8 commits into
mainfrom
9-improve-project-card-cover-image-handling

Conversation

@norioriroiron

Copy link
Copy Markdown
Contributor

No description provided.

@norioriroiron norioriroiron linked an issue Jul 18, 2026 that may be closed by this pull request
7 tasks
Comment thread src/components/CardCover.astro Outdated
width={cover.width}
height={cover.height}
loading="lazy"
class="h-full w-full object-cover blur-sm"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On cover images that aren't the default size / aspect ratio, there's a slight border/fringe at the tile edges. Scaling the blurred background image up a bit removes that border. Just adding a scale-125 class to this line should fix it - it zooms the image in slightly so that border isn't visible

Comment thread src/components/CardCover.astro Outdated
<div class="h-full w-full">
<Image
src={cover}
alt={`Cover image for ${title}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both the blurred background image and main foreground image have the alt text, screen readers would mention it twice. Remove the duplication by setting alt = "" (empty string) and also add aria-hidden="true"

Comment thread src/components/CardCover.astro Outdated
</div>
) : (
<div class="bg-accent flex h-full w-full items-center justify-center p-3">
<p class="text-accent-contrast text-center text-3xl font-bold">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's more on me since I left it open ended in the ticket description, but while playing around with the no cover image fallback card appearance, I think a simpler look with bg-canvas instead of bg-accent (line 41) and text-ink instead of text-accent-contrast (line 42) works better, since a more subtle look for projects with no cover image feels more fitting

Also, we can add an aria-hidden="true" class to the

tag since its the same text as the card's heading that has the project title, so screen readers would read the same text twice in the no cover image fallback case

Comment thread src/components/CardCover.astro Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this todo comment at this point since the change has been implemented

@norioriroiron
norioriroiron requested a review from AJaccP July 26, 2026 00:38
@AJaccP
AJaccP merged commit a1da7c1 into main Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve project card cover image handling

2 participants