Skip to content

Captions: shrink-to-fit alignment (short center, long flush-left) - #49

Merged
HumbleBee14 merged 1 commit into
mainfrom
design/caption-alignment
Sep 5, 2026
Merged

Captions: shrink-to-fit alignment (short center, long flush-left)#49
HumbleBee14 merged 1 commit into
mainfrom
design/caption-alignment

Conversation

@HumbleBee14

Copy link
Copy Markdown
Member

Fixes short captions being left-aligned under centered tables/figures, without breaking long ones.

.inline-figure-caption becomes a shrink-to-fit box (display: table + margin-inline: auto + text-align: left):

  • Short caption → box hugs the text → appears centered
  • Long caption → box fills to max-width, wraps → reads flush-left (a centered multi-line block gives a ragged left edge that's hard to track on return sweeps)

No line-counting/JS. Covers tables, SVGs, images, video. Preview and published share this class, so both stay in sync.

Left the hero .figure-caption (FIG-label figure) alone on purpose — its captions are always multi-line, so by the same rule they're already correctly flush-left.

Short captions hug their text (appear centered); multi-line captions
fill to max-width and read flush-left, avoiding a ragged left edge on
return sweeps. Fixes the left-aligned short captions under centered
tables/figures. Preview and published share the class, so both sync.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mlsystems with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9f5cd4a
Status: ✅  Deploy successful!
Preview URL: https://2992b55f.mlsystems.pages.dev
Branch Preview URL: https://design-caption-alignment.mlsystems.pages.dev

View logs

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

@HumbleBee14
HumbleBee14 merged commit 1ab3509 into main Sep 5, 2026
2 checks passed
@HumbleBee14
HumbleBee14 deleted the design/caption-alignment branch September 5, 2026 09:49
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.

1 participant