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 white background on snapshot image thumbnail with transparent backgroundColor #283

Merged
merged 2 commits into from Apr 5, 2024

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Apr 4, 2024

If the backgroundColor for a snapshot is transparent (e.g. rgba(0, 0, 0, 0) which is the default), the thumbnail would render against that transparent background rather than the intended white background (which would be the effective page background color). This fixes that issue and adds some stories to verify it.

Screenshot 2024-04-04 at 20 42 02 Screenshot 2024-04-04 at 20 43 32

Additionally, I tweaked the UI to have a little border around the snapshot, similar to what we have on the Chromatic webapp (note the white border):

Screenshot 2024-04-04 at 20 03 01

@ghengeveld ghengeveld added skip-release Auto: Preserve the current version when merged patch Auto: Increment the patch version when merged labels Apr 4, 2024
@ghengeveld ghengeveld force-pushed the fix-snapshot-thumbnail-background branch from b2b1157 to f078167 Compare April 4, 2024 18:26
@ndelangen
Copy link
Member

How do you know the intended background is white?

@ghengeveld
Copy link
Member Author

How do you know the intended background is white?

Because white is the default page background color since the earliest days of the web. If there is no background color specified, that's what our capture browsers will render.

@ghengeveld ghengeveld merged commit 40a4b94 into main Apr 5, 2024
8 checks passed
@ghengeveld ghengeveld deleted the fix-snapshot-thumbnail-background branch April 5, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Auto: Increment the patch version when merged skip-release Auto: Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants