blog.rust-lang.org icon indicating copy to clipboard operation
blog.rust-lang.org copied to clipboard

Add dark mode support

Open mseele opened this issue 2 years ago • 8 comments

I often read the rust blog in the dark and always wonder why there is no dark mode.

It would be really cool if the rust blog had a dark mode. Is there anything against it?

mseele avatar Jan 04 '24 18:01 mseele

Dark mode is well-supported in Rustdoc. Seems logical to support it here as well.

CleanCut avatar Jan 08 '24 17:01 CleanCut

@mseele do you want to help implement it? :)

Turbo87 avatar Jan 22 '24 09:01 Turbo87

@Turbo87 if anyone can help with the visual design (where to place the light/dark button, choice of colors, etc.) I can take a look

mseele avatar Jan 22 '24 19:01 mseele

unfortunately, that's the same problem we have with crates.io. we have the dev skills to implement it, but visual design is not a strong skill for us 😅

Turbo87 avatar Jan 23 '24 05:01 Turbo87

Dark mode (imo) doesn't necessarily need a JavaScript switch button. Using the CSS prefer-color-scheme property, the browser automatically shows the website based on the user preferences (either set in the browser or in the system prefs).

An alternate color set autogenerated by a browser extension could be:

color: #e8e6e3;
background-color: #222;

replacing the SCSS variables with these should get us already to a half-working dark theme

grafik

apiraino avatar Feb 07 '24 12:02 apiraino

Here's a quick user style I threw together that can be used until this feature is implemented:

@media (prefers-color-scheme: dark) {
    body {
        background-color: black;
        filter: invert(1.0);
    }
}

fenhl avatar Mar 26 '24 21:03 fenhl

A very simple UserCSS: https://github.com/teohhanhui/rust-blog-dark

teohhanhui avatar Jun 13 '24 17:06 teohhanhui

sigh you guys pushed me over the cliff #1343 :smile:

apiraino avatar Jun 13 '24 19:06 apiraino

aaaand ... it's online! :rocket:

apiraino avatar Aug 26 '24 22:08 apiraino