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

wiki: contribution cycle diagram has a borked SVG under dark mode #65059

Closed
Jorropo opened this issue Jan 11, 2024 · 20 comments
Closed

wiki: contribution cycle diagram has a borked SVG under dark mode #65059

Jorropo opened this issue Jan 11, 2024 · 20 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. website
Milestone

Comments

@Jorropo
Copy link
Member

Jorropo commented Jan 11, 2024

See https://go.dev/wiki/Go-Release-Cycle
Screenshot from 2024-01-11 09-43-09

This is failing identically both in chromium and firefox.

Trying to open the svg in it's own page give funny results:
Screenshot from 2024-01-11 09-43-57
(again chromium and firefox failing in the same way)

@gopherbot gopherbot added this to the Unreleased milestone Jan 11, 2024
@Jorropo
Copy link
Member Author

Jorropo commented Jan 11, 2024

Idk where to find something correct or how to fix this svg, so here is an issue instead. I don't know where to report wiki issues so 🤞 this is correct.

@mauri870
Copy link
Member

I remember seeing this diagram not so long ago and it was in the right shape. Here is one from the wayback machine https://web.archive.org/web/20231209042740/https://github.com/golang/go/wiki/Go-Release-Cycle

@mauri870
Copy link
Member

Probably related with the migration of the wiki to go.dev #61940

@mauri870
Copy link
Member

Actual markdown page in x/wiki shows the svg is fine, might have to do with it blending in with the website background colors

https://github.com/golang/wiki/blob/master/Go-Release-Cycle.md

@mauri870 mauri870 added help wanted NeedsFix The path to resolution is known, but the work has not been done. website labels Jan 11, 2024
@mauri870
Copy link
Member

No x/wiki at https://dev.golang.org/owners, so I'm pinging the website folks. We might want to add x/wiki to the owners file

/cc @golang/tools-team

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/555375 mentions this issue: devapp/owners: add x/wiki repo and owners

@hyangah
Copy link
Contributor

hyangah commented Jan 11, 2024

What version/os of the firefox and chromium? I assume you could reproduce it without any extensions, right?
My firefox 121.0.1 on mac seems to work fine in both dark/non-dark modes.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 11, 2024
@Jorropo
Copy link
Member Author

Jorropo commented Jan 11, 2024

My chromium has no extensions installed,
Using arch linux
Firefox and Chromium are updated to the latest non beta release (121.0.1 for ff, 120.0.6099.199 for chromium)
I have dark style enabled in gnome
And the browsers are set to track the system's preference.

@Jorropo
Copy link
Member Author

Jorropo commented Jan 11, 2024

Disabling « Dark Style » option in Gnome and restarting the browser fixes it.

@Jorropo Jorropo changed the title x/wiki: contribution cycle diagram has a borked SVG x/wiki: contribution cycle diagram has a borked SVG under dark mode Jan 11, 2024
@dagood
Copy link
Contributor

dagood commented Jan 16, 2024

Also repros for me on Windows 11.

  • Microsoft Edge for Business Version 120.0.2210.133 (Official build) (64-bit)
  • Firefox 121.0.1 (64-bit)

If I toggle off this rule in my inspector, it looks great with browser dark theme + website dark mode:

image

image

However, it seems to me that the intent was probably to make the svg always have a white background and always have black text/outlines. A dark browser theme just makes the svg's text/outlines white unexpectedly.

@Jorropo
Copy link
Member Author

Jorropo commented Jan 16, 2024

I can repro your fix. It seems to me this rule is spurious. Will send CL. thx

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/556158 mentions this issue: _content: remove white background on article images

@dagood
Copy link
Contributor

dagood commented Jan 16, 2024

Hmm, sorry, I'm actually not sure it's that simple: even if I disable the rule, if I have my browser theme dark and set the website to its light theme, then the text is white-on-white. (Because the page background itself is white, and my browser's dark theme is still somehow forcing the svg text to be white.)

@dagood
Copy link
Contributor

dagood commented Jan 16, 2024

Ah, the svg actually contains this css internally:

text {
	fill: black;
}
line, path {
	stroke: black;
	fill: none;
}
@media (prefers-color-scheme: dark) {
	text {
		fill: white;
	}
	line, path {
		stroke: white;
	}
}

Don't know how to counteract that from the outside (if possible) but I imagine it would be easy to snip from the svg?

This works for me: https://github.com/golang/go/assets/12819531/2cec3672-7941-49f2-b315-5dea0670469e go-release-cycle-diagram

@dmitshur dmitshur changed the title x/wiki: contribution cycle diagram has a borked SVG under dark mode wiki: contribution cycle diagram has a borked SVG under dark mode Jan 19, 2024
@mauri870
Copy link
Member

If this turns out difficult to handle, can't we add a color to the svg background instead of keeping it transparent? This way independently of the page background color the text should still be readable. Downside is that we'll see the image borders.

@adonovan
Copy link
Member

adonovan commented Jan 24, 2024

If this turns out difficult to handle, can't we add a color to the svg background instead of keeping it transparent? This way independently of the page background color the text should still be readable. Downside is that we'll see the image borders.

I agree, this is a simple and robust solution. And if you can be bothered to make the border line a double stripe of black and white then it will be visible in both modes.

There have been attempts to make transparent vector images that look good in both modes (e.g. https://forum.obsidian.md/t/auto-adaptive-images-for-dark-light-theme/13494), essentially by using mid-grey as the primary ink, but to my eyes they end up looking low-contrast in both modes.

I do wonder what the designers who originated "dark mode" had in mind as a plan for transparent images. Surely adaptive CSS cannot be the answer.

@Jorropo
Copy link
Member Author

Jorropo commented Jan 24, 2024

FWIW my browser recognize the black on black and invert the strokes to white.
That sounds like an awfully fragile solution but so is most things on the web isn't it ?

gopherbot pushed a commit to golang/wiki that referenced this issue Jan 27, 2024
This seems to interfere with the website's css and its
own dark mode theme control.

For golang/go#65059

Change-Id: I1aedeb7c177ae81b9e9a49452b9b7a2f87ca884f
Reviewed-on: https://go-review.googlesource.com/c/wiki/+/558660
Commit-Queue: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/558660 mentions this issue: wiki/images: remove release-cycle.svg prefers-color-scheme

@hyangah
Copy link
Contributor

hyangah commented Jan 27, 2024

Thanks all. I removed the dark theme setting from the svg image (and also checked in the svg file to the wiki repo).

Can you please check if this makes any improvement?

From my testing with system dark mode

Before:

Screenshot 2024-01-27 at 12 52 51 PM

After:
Screenshot 2024-01-27 at 1 03 20 PM

@Jorropo Jorropo removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 27, 2024
@mauri870
Copy link
Member

I just checked it again in Firefox and Chrome and it is much better now! The text is readable in both dark and light modes. Thank you @hyangah for addressing this issue!

Additionally, there is a new Contributing page providing detailed instructions on reporting wiki-related issues.

I am closing this issue as completed. Thanks to all those involved!

@golang golang locked and limited conversation to collaborators Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. website
Projects
None yet
Development

No branches or pull requests

6 participants