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

White background for screenshots on dark mode is jarring #8308

Open
parlough opened this issue Nov 19, 2024 · 4 comments
Open

White background for screenshots on dark mode is jarring #8308

parlough opened this issue Nov 19, 2024 · 4 comments

Comments

@parlough
Copy link
Member

The white background for screenshots (when not expanded) can be jarring. It's perhaps a safe choice as developers may have added screenshots that assume a white background, but they detract from the purpose of dark mode.

Perhaps we could add guidelines that screenshots should expect a light or dark background, or enable a way to specify screenshots for each mode.

@isoos
Copy link
Collaborator

isoos commented Nov 19, 2024

Maybe a long shot, but if we could detect that a screenshot is too bright for dark mode, it could be a feedback in pana's analysis. Maybe we could even create a dimmed-down version, or just flag it that it needs dimming through CSS style?

@sigurdm
Copy link
Contributor

sigurdm commented Nov 19, 2024

Maybe a long shot, but if we could detect that a screenshot is too bright for dark mode, it could be a feedback in pana's analysis.

Not a bad idea: https://stackoverflow.com/a/38213966/4809566 has a suggestion for detecting brightness from javascript - we would probably do it server-side from pana, but it might not be that difficult...

@isoos
Copy link
Collaborator

isoos commented Nov 19, 2024

Yeah, that could be used not only on screenshots, but every image a page may include.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 19, 2024

but every image a page may include.

We can probably only do that after we proxy the image data.
Using an external image in the fiddle gets a Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at img.onload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants