-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fixed Colorblindness Emulation #6297
Conversation
Codecov Report
@@ Coverage Diff @@
## next #6297 +/- ##
==========================================
- Coverage 38.29% 38.27% -0.02%
==========================================
Files 648 648
Lines 9839 9844 +5
Branches 387 387
==========================================
Hits 3768 3768
- Misses 6011 6016 +5
Partials 60 60
Continue to review full report at Codecov.
|
Thank you! |
Which snapshots? The only test I see for this addon is for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! Minor comment above
@@ -8,6 +8,16 @@ import { Icons, IconButton, WithTooltip, TooltipLinkList } from '@storybook/comp | |||
|
|||
const getIframe = memoize(1)(() => document.getElementById('storybook-preview-iframe')); | |||
|
|||
const getFilter = (filter: string | null) => { | |||
if (filter === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is !filter
better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could, but I wanted to be "strict" and consistent, since the reset is this.setFilter(null);
and there's a similar check if (filter !== null) {
Oh, of course. TeamCity build confused me. |
Issue: #5959
What I did
display: none
, but Firefox won't render filters that are set todisplay: none
(see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display and https://benfrain.com/applying-multiple-svg-filter-effects-defined-in-css-or-html/), so I've used the position absolute no sizes technique.filter: url("#null")
tofilter: none
, since Firefox doesn't render filters that are not found (and the code doesn't have a filter with idnull
) while the correct property in css isnone
(see https://developer.mozilla.org/en-US/docs/Web/CSS/filter)active
property to the selection list, to show the selected filterHow to test
Run storybook in Firefox and use the Colorblindness selection list