Skip to content

Improve news card image framing and text alignment#987

Draft
RisingOrange wants to merge 7 commits into
PauseAI:mainfrom
RisingOrange:news-card-images
Draft

Improve news card image framing and text alignment#987
RisingOrange wants to merge 7 commits into
PauseAI:mainfrom
RisingOrange:news-card-images

Conversation

@RisingOrange

@RisingOrange RisingOrange commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Two related improvements to the news cards: images are no longer cropped, and card text lines up across a row.

Image framing

The cards used aspect-ratio: 16/10 with object-fit: cover for every image, cropping the edges of anything that wasn't already a matching landscape shape — posters, charts and Substack banners lost content.

Following the existing post-banner design system (#702), which standardizes internal post images to a curated 1200/628 crop:

  • Card frame now uses aspect-ratio: 1200 / 628 to match the post banner ratio.
  • Internal post images keep object-fit: cover — they're curated to frame well at this ratio. Their Image aspectRatio hint is updated to 1200/628 so the responsive sizes math stays accurate.
  • Substack/press images (arbitrary shapes we don't control) use object-fit: contain, so charts, posters and tall portraits show in full instead of being cropped.
  • The image container gets a --bg-subtle background so the contained letterbox blends with the card body.
  • Hover zoom (scale(1.03)) is scoped to cover-cropped images only — zooming a contained image would re-crop it under overflow: hidden.

Text alignment

Titles run from one to three lines, so each card's description started at a different height and short titles left a gap above their description.

  • The title now reserves a fixed three-line area and is vertically centered within it, so descriptions line up regardless of title length. Three lines (not two) because several real titles need three at the site's condensed heading font — two would clip them mid-word.
  • The 2-line clamp lives on an inner span, because -webkit-line-clamp needs display: -webkit-box, which can't coexist with the flex centering. The title area is a column flex so the loading skeleton bars still stack.
  • Dates already align (pinned to the bottom of equal-height cards).

Before / After

These are real screenshots of the running site (dev server, live news data, actual fonts and theme) — not mockups.

In before: PauseCon's wordmark is clipped, Fable 5 is cut off on both sides, the chart and portraits are cropped, and the row-1 descriptions ("Apply now" / "Hundreds of…" / "The US reaction…") sit at three different heights. In after: images show in full and the descriptions line up.

Before:

Before

After:

After

Verification

  • pnpm check — 0 errors; pnpm _lint:knip — passes; eslint clean
  • Rendered and captured from the running dev server with live prod news data, confirming object-fit: contain resolves correctly for external images inside NetlifyImage's <picture> wrapper, that no title is truncated, and that the loading skeleton still stacks.

Match the card image frame to the 1200/628 post-banner crop and switch
image fit by source: internal post images (curated to frame well at that
ratio) keep object-fit: cover, while Substack/press images (arbitrary
shapes we don't control) use object-fit: contain so charts, posters and
banners aren't cropped. The container gets a bg-subtle background so the
contained letterbox blends with the card.
@netlify

netlify Bot commented Jul 18, 2026

Copy link
Copy Markdown

👷 Deploy request for pauseai pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c1b8bf7

The hover scale(1.03) was applied to all card images; for contained
(external) images the container's overflow:hidden then clips the enlarged
image, cutting off ~1.5% on hover and defeating the point of contain.
Scope the zoom to cover-cropped internal images only.
Resolve NewsCard.svelte image conflict: combine the source-based object-fit
(cover internal / contain external) with main's new Image aspectRatio prop,
updating it to 1200/628 to match the new card image frame.
RisingOrange added a commit to RisingOrange/pauseai-website that referenced this pull request Jul 18, 2026
@RisingOrange
RisingOrange marked this pull request as ready for review July 18, 2026 12:52
@RisingOrange
RisingOrange marked this pull request as draft July 18, 2026 13:12
Titles vary from one to three lines, so subtitles started at different
heights across a row. Reserve a fixed two-line title area and vertically
center the title within it: subtitles now line up regardless of title
length, and short one-line titles no longer leave a gap above the
subtitle. The line clamp moves to an inner span because -webkit-line-clamp
needs display:-webkit-box, which can't coexist with the flex centering.
@RisingOrange RisingOrange changed the title Show news card images without cutting them off Improve news card image framing and text alignment Jul 18, 2026
RisingOrange added a commit to RisingOrange/pauseai-website that referenced this pull request Jul 18, 2026
The fixed-height title area uses display:flex; making it column so the
two loading skeleton bars stack on separate lines again instead of
shrinking side-by-side, while keeping the loaded single-line/two-line
title vertically centered.
@RisingOrange
RisingOrange marked this pull request as ready for review July 18, 2026 14:10
@Wituareard

Wituareard commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

The screenshots looks very different from what I get in production (font etc), why is that?

Two lines was enough in a mockup but not with the site's actual condensed
heading font, where several real titles need three lines and were being
clipped mid-word ("...back i...", "...used to smear..."). Reserve three
lines instead; subtitles still align and the clamp only engages for
titles longer than that.
RisingOrange added a commit to RisingOrange/pauseai-website that referenced this pull request Jul 21, 2026
@RisingOrange
RisingOrange marked this pull request as draft July 21, 2026 21:00
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.

2 participants