Skip to content
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

Fix callout spacing for new callouts (sans icons) #586

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

wustep
Copy link
Contributor

@wustep wustep commented Nov 18, 2024

Description

See issue #565

Notion recently introduced two changes to callouts:

  • There is no longer a forced text title and instead we just have block contents, allowing blocks like <h1> at the top of a callout.
  • You can remove the icon from the callout entirely (this was me 😉).

This led to some minor visual issues with react-notion-x.

In this PR, we:

  • Remove the icon entirely when it is missing
  • Removes the top padding/margins on the callout text's first child.

Notion Test Page ID

1425cb08cf2c80efb771e6010d8dac21

Notion
CleanShot 2024-11-18 at 01 07 33@2x

Main [before change]
https://react-notion-x-demo.transitivebullsh.it/1425cb08cf2c80efb771e6010d8dac21

CleanShot 2024-11-18 at 01 07 19@2x

After change
CleanShot 2024-11-18 at 01 09 22@2x

Old callouts are fine too
CleanShot 2024-11-18 at 01 28 57@2x

(Note: there seems to be a funny bug with adjacent headings being rendered on the same line 😛. This is not addressed in this PR.)

Copy link

vercel bot commented Nov 18, 2024

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

Name Status Preview Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview Nov 18, 2024 9:15am
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Nov 18, 2024 9:15am

@transitive-bullshit
Copy link
Member

Thanks @wustep 🙏

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