Movatterモバイル変換


[0]ホーム

URL:


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

fix: table collection padding calculation#603

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alaycock wants to merge1 commit intoNotionX:master
base:master
Choose a base branch
Loading
fromalaycock:fix-collection-spacing

Conversation

@alaycock
Copy link
Contributor

@alaycockalaycock commentedJan 12, 2025
edited
Loading

Description

The padding calculation for a "table collection" is incorrect for pages with a width other than 708. The renderer should allow this to be overridden. For example, your own site uses 900px for--notion-max-width.

My proposed fix is to pass in apageWidth property to the renderer. An alternative would be to query the width of thediv.notion-page-content element on the page. This felt less intrusive.

Screenshot: Over-calculated padding, due to the default page widthimage

This PR solves also two more bugs impacting the padding calculation:

  • useWindowSize, usingwindow.width, includes the scrollbar width as part of the page width. Instead,document.documentElement.clientWidth can be used for just the document width.
  • The calculation for padding on narrow screens under is off-by-one 1vw on each side.
The table is too wide on narrow screens, caused by the additional two bugs aboveimage

Notion Test Page ID

https://adaminthehills.notion.site/Hi-I-m-Adam-164d424ea49f80c9b216c4425ca573c8?pvs=4

@vercel
Copy link

vercelbot commentedJan 12, 2025
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewUpdated (UTC)
react-notion-x✅ Ready (Inspect)Visit PreviewJan 13, 2025 3:08am
react-notion-x-minimal-demo✅ Ready (Inspect)Visit PreviewJan 13, 2025 3:08am

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@alaycock

[8]ページ先頭

©2009-2025 Movatter.jp