Skip to content

x/website: Fuzzing documentation image has transparent background, works poorly with dark mode #54954

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

Closed
carlpett opened this issue Sep 8, 2022 · 7 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. website

Comments

@carlpett
Copy link

carlpett commented Sep 8, 2022

The fuzzing page, https://tip.golang.org/security/fuzz/, has an image describing different components involved. It however has a transparent background, and with the page supporting dark mode, the image gets very tricky to read:
image

I'm not sure if having a opaque white background would be problematic, but that seems to be the easiest solution.

@gopherbot gopherbot added this to the Unreleased milestone Sep 8, 2022
@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Sep 8, 2022
@mvdan
Copy link
Member

mvdan commented Sep 8, 2022

An alternative might be a white background with 50% opacity, then at least you don't get a block of solid white light on dark mode.

@mknyszek mknyszek added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 8, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Sep 8, 2022

CC @dmitshur

@cameronldroberts
Copy link

Hey would like to pick this up if possible :)

@Deleplace
Copy link
Contributor

Deleplace commented Oct 10, 2022

Cameron's fix is one fine way to solve this. It makes the code readable again, at the cost of having block with white background inside a dark page.

I can think of 2 other approaches that would "save" the ambiant dark background:

@Deleplace
Copy link
Contributor

Deleplace commented Oct 27, 2022

I experimented 2 ways of adding a light-tone shadow:

  • With the CSS style filter: drop-shadow(0.5px 0.5px 0.3px #CCC);

image

  • By editing the original image

image

While these have the advantage of having a single transparent PNG that works in both light theme and dark theme, I'm still not satisfied with the readability of the dark version.

See my next comment instead.

@Deleplace
Copy link
Contributor

Deleplace commented Oct 27, 2022

We can achieve much better results by serving a different image for light theme (default) and dark theme.

Something like

<picture>
	<source srcset="/security/fuzz/example_dark.png" media="(prefers-color-scheme: dark)" type="image/png">
	<img alt="Example code showing [...]" src="/security/fuzz/example.png" style="display: block; width: 600px; height:
auto;">
</picture>

image

image

I could make a CL for this.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/454875 mentions this issue: Fuzzing article: fix transparent image for dark theme.

@golang golang locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. website
Projects
None yet
Development

No branches or pull requests

7 participants