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(popper): Resolving issue where PopoverArrow would have different border than contents #6412

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tenkir
Copy link

@Tenkir Tenkir commented Aug 2, 2022

Closes #5934.

📝 Description

PopoverArrow used a box-shadow with blur to generate the borders on it's edges. This resulted in a blurry border, when the border of the rest of the popover was solid. This was particularly noticeable on dark backgrounds.

⛳️ Current behavior (updates)

Old borders over dark background

PopoverArrow always had blurred border, which was detatched from the Popover content.

🚀 New behavior

New borders over dark background

PopoverArrow will have the same border as the rest of the PopOver or Tooltip.

This PR uses variations of border to generate the borders, rather than a box-shadow implementation.

By using transparent borders on the interior edges of the arrow, we can eliminate the overlap typically seen with border implementations. This results in accurate borders which match the rest of the container.

Border Explaination

Here is a minimum CSS implementation of adding a transparent border on right side, compared to no transparent border on left:

Transparent border example

This PR also removes the now unused getBoxShadow function from packages/popper/src/utils.ts

💣 Is this a breaking change (Yes/No):

No

Additional Information

Not sure if this small visual change requires a test, but I can add one if necessary.

@changeset-bot
Copy link

changeset-bot bot commented Aug 2, 2022

🦋 Changeset detected

Latest commit: fa7e182

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@chakra-ui/popper Minor
@chakra-ui/menu Patch
@chakra-ui/popover Patch
@chakra-ui/react Patch
@chakra-ui/tooltip Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Aug 2, 2022

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

Name Status Preview Updated (UTC)
chakra-ui-storybook ✅ Ready (Inspect) Visit Preview Oct 9, 2023 1:57pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 2, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d74e227:

Sandbox Source
create-react-app-ts Configuration

@Tenkir Tenkir changed the title fix: Resolving issue where PopoverArrow would have different border than contents fix(popper): Resolving issue where PopoverArrow would have different border than contents Aug 3, 2022
@Tenkir Tenkir force-pushed the fix/box-shadow-on-popoverarrow branch 2 times, most recently from 95dc051 to 40bb9a3 Compare August 26, 2022 14:55
@Tenkir
Copy link
Author

Tenkir commented Aug 26, 2022

Rebased with main and cleaned up commits.

@KubaZachacz
Copy link

KubaZachacz commented Jul 27, 2023

Can't wait to see it on production :)

@Stanzilla
Copy link

Stanzilla commented Sep 16, 2023

@segunadebayo poke

@SeaStove
Copy link

Any update on this being pulled in? Not sure how to even bandaid it to make the the shadow appear around the arrow. This hack another user suggested only works if your designs include a border for the tooltip #5203 (comment)

@Tenkir
Copy link
Author

Tenkir commented Apr 10, 2024

@segunadebayo There is still a small issue here, which I highlight in #5934. I can update this PR and bring it up to date if there's any appetite to fix this minor issue.

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.

PopoverArrow always has box shadow blur, even when border is solid.
4 participants