Refined-github: Toggle for Github Theme

Created on 9 Dec 2020  ·  13Comments  ·  Source: sindresorhus/refined-github

Since github is supporting theme natively now, Could you please add a toggle on home screen for toggling the theme right away from the Homepage of github instead of sifting through appearance settings?

enhancement under discussion

Most helpful comment

Both macOS and Windows have a system dark mode. Having to switch every website when the sun goes down sounds like extra unnecessary work.

Set “auto” and use your system’s dark mode to change everything at once.

All 13 comments

Why?

Why?

Why? :disappointed:
Because it will be easier for changing theme on website according to your time...as most people switch to dark-mode during night time to get rid of eye strain,and use light mode during day time

One way of achieving this is on macOS is to configure the GitHub theme to follow the system settings:

Screenshot of GitHub's theme settings, with the 'Default to system' option selected

And also configure your macOS appearance to switch automatically depending on the time of day:

Screenshot of the macOS appearance section in the general system preferences with the 'Auto' option selected

For advanced use cases, you can use NightOwl to switch the appearance from your menu bar and customize it per app.

You can use the "auto" option.

That said, I see this feature is useful and easy to implement. Will spin up a script (and possibly a PR) later:

  • Change data-color-mode of html
  • POST to https://github.com/settings/color_mode.<username> with:

    _method: put
    authenticity_token: ...
    color_mode: <mode>
    

I've just stolen the GitHub's switches instead:

image

Because it will be easier for changing theme on website according to your time...as most people switch to dark-mode during night time to get rid of eye strain,and use light mode during day time

As mentioned, you can already do this by making it follow your system. I don't really see the point in having a different theme on GitHub than your system. That being said, I don't feel strongly if any of the other maintainers wants this.

Both macOS and Windows have a system dark mode. Having to switch every website when the sun goes down sounds like extra unnecessary work.

Set “auto” and use your system’s dark mode to change everything at once.

But there are Linux users too (Firefox has good support but not for Chromium). And this is also useful for developers who need to test both light and dark themes for their GitHub related applications (such as me right now 😄).

As this feature doesn't likely go into Refined GitHub, here is a user script based on my PR.

But there are Linux users too.

It's a bit hackish, but you can have a "global" dark mode switch in Linux too, at least for GTK-based applications like Firefox. Not sure about Chrome/Chromium.

I agree this belongs more in a separate user script.

But there are Linux users too

It’s Linux. They can do everything they set their mind to.

And this is also useful for developers who need to test both light and dark themes for their GitHub related applications (such as me right now 😄).

I do it too, globally. There’s no point in adding a switch to every website. You can probably have a global shortcut on every OS that changes the color everywhere in an instant.

If it’s something you need to do frequently, I suggest a bookmarklet that toggles the color in one click by fetching the form and resubmitting it.

And this is also useful for developers who need to test both light and dark themes for their GitHub related applications

This is a very niche use-case though.

By the way, if you go to your GitHub profile, there's a toggle in the top-right corner.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yakov116 picture yakov116  ·  3Comments

olso picture olso  ·  3Comments

alexanderadam picture alexanderadam  ·  3Comments

supremebeing7 picture supremebeing7  ·  3Comments

juliocanares picture juliocanares  ·  3Comments