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

[Bug]: preview area has weird border with blurred vision filter #25818

Open
vanessayuenn opened this issue Jan 30, 2024 · 8 comments · May be fixed by #28844
Open

[Bug]: preview area has weird border with blurred vision filter #25818

vanessayuenn opened this issue Jan 30, 2024 · 8 comments · May be fixed by #28844

Comments

@vanessayuenn
Copy link
Contributor

Describe the bug

Project: MealDrop
Version: 8.0.0-alpha.14
Bug/feedback:

When activating the blurred vision filter from the accessibility addon, the preview area shows weird borders:

Storybook 7

Storybook 8

This is caused because of this newly added box-shadow in the preview iframe:
https://github.com/storybookjs/storybook/blob/next/code/ui/manager/src/components/preview/Iframe.tsx#L16

To Reproduce

  1. Go to https://stackblitz.com/edit/github-csg7tu
  2. Open any story
  3. Use the blurred vision filter from addon-a11y

System

No response

Additional context

No response

@ghidersamihaela
Copy link
Contributor

Hi, I would like to look into this.

@yannbf
Copy link
Member

yannbf commented Feb 9, 2024

Hey @ghidersamihaela thanks for your help! Follow our contribution docs for some guidance and feel free to reach out on discord for further assistance. Thank you!

@ghidersamihaela
Copy link
Contributor

ghidersamihaela commented Feb 18, 2024 via email

@Tomsxmart
Copy link

Hi. It is caused by div with id "storybook-preview-wrapper" not having an appropriate background color.

Giving the element background of white gets rid of the issue - but this should be implemented keeping in mind that the issue will still persist if user clicks dark mode on. So we should use a variable that determines dark mode or light mode (if there is one?)

I'm personally unable to make the PR since i cannot recreate the project locally (i assume since i'm running on windows, i tried WSL as well - did not work)

@RuxueJ
Copy link

RuxueJ commented Jun 21, 2024

Hi, Saad, Allison and I (a group in CTI codeday program) will work on this problem!

@RuxueJ
Copy link

RuxueJ commented Jul 24, 2024

@yannbf Our Codeday group discussed the issue of the "weird border." We discovered that it is caused by the interaction of two CSS styles: the filter blur(2px) /home/ruxue/shared_storybook/code/addons/a11y/src/components/VisionSimulator.tsx and the iframe CSS setting boxShadow: '0 0 100px 100vw rgba(0,0,0,0.5)' /home/ruxue/shared_storybook/code/core/src/manager/components/preview/Iframe.tsx . When both styles are applied to the iframe, the weird border appears.
We have come up with two potential solutions. The first is to delete the boxShadow CSS since it does not seem to take effect. However, we believe this would only temporarily remove the problem. If there are more adjustments to this CSS in the future, the same issue might reoccur.

The second solution is to apply the filter to the storybook-root element within the iframe, rather than to the iframe itself. Is this method acceptable for you?

@ghengeveld
Copy link
Member

@RuxueJ if y'all can figure out a way to apply the blur only to the contents of the iframe rather than the iframe itself, that would be the best solution.

@RuxueJ
Copy link

RuxueJ commented Aug 9, 2024

We use useEffect hook to apply the filters to the content in the iframe instead of the iframe itself and fix the bug.
We send a pull request. Please review. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

6 participants