Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support new object-fit property on individual card cover image #3594

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

Merged

Conversation

Copy link
Contributor

@viktorrenkema viktorrenkema commented Aug 26, 2025
edited
Loading

This PR implements the GBO-side of allowing the object-fit property on cards. Table record fields for cover image now not only accept api.ContentRefFile | api.ContentRefURL, but also an object that contains record-level configurations like object-fit where then the content ref will be nested:

export type TableDefinitionImageRecord =
 | api.ContentRefFile
 | api.ContentRefURL
 | {
 ref: api.ContentRefFile | api.ContentRefURL;
 objectFit?: api.CardsImageObjectFit;
 };

If an object-fit is used that results in the background of the card being visible, we apply a subtle bg tint-color of the configured customization styles.

see https://github.com/GitbookIO/gitbook-x/pull/19221

Preview

CleanShot.2025年08月25日.at.09.40.03.mp4

Copy link

linear bot commented Aug 26, 2025

Copy link

changeset-bot bot commented Aug 26, 2025
edited
Loading

⚠️ No Changeset found

Latest commit: 705ff63

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

argos-ci bot commented Aug 26, 2025
edited
Loading

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 17 changed Sep 3, 2025, 6:41 AM
v2-cloudflare (Inspect) 👍 Changes approved 15 changed Sep 3, 2025, 6:44 AM
v2-vercel (Inspect) 👍 Changes approved 19 changed Sep 3, 2025, 6:43 AM

Copy link
Member

@nolannbiron nolannbiron left a comment

Choose a reason for hiding this comment

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

lgtm, just need to update the types once the API changes are released

@viktorrenkema viktorrenkema force-pushed the viktor/rnd-7202-card-covers-aspect-ratio-is-wrong branch from d8110f3 to c9b9f0b Compare September 2, 2025 15:17
@viktorrenkema viktorrenkema force-pushed the viktor/rnd-7202-card-covers-aspect-ratio-is-wrong branch from c9b9f0b to d63a0ab Compare September 2, 2025 15:24
@viktorrenkema viktorrenkema merged commit 5f6853d into main Sep 3, 2025
16 checks passed
@viktorrenkema viktorrenkema deleted the viktor/rnd-7202-card-covers-aspect-ratio-is-wrong branch September 3, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@gregberge gregberge gregberge approved these changes

@nolannbiron nolannbiron nolannbiron approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /