The pkg.go.dev site currently renders either a light color
scheme or a dark color scheme based on your web browser’s
preference (typically, this is based on your operating system’s color scheme
settings). The site does not allow you to manually toggle the color scheme on
the page UI.
document.cookie = "prefers-color-scheme=light" // for light scheme
document.cookie = "prefers-color-scheme=dark" // for dark scheme
Reload the page after.
These cookies were once being used to let users toggle the color scheme, but the feature was rolled back due to an issue. But the cookies still work partially.
I much like the light scheme on the site, though my operating system color scheme is dark.
Update: There is a working color scheme switcher button at the bottom of pkg.go.dev pages now.