sindresorhus/refined-github

Toggle for Github Theme #3802

aliglelo posted onGitHub

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?


Why?

posted by sindresorhus over 4 years ago

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

posted by aliglelo over 4 years ago

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

<img width="769" alt="Screenshot of GitHub's theme settings, with the 'Default to system' option selected" src="https://user-images.githubusercontent.com/11017722/101611392-ba523b00-3a09-11eb-8fa1-8e1608b9bfa7.png">

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

<img width="358" alt="Screenshot of the macOS appearance section in the general system preferences with the 'Auto' option selected" src="https://user-images.githubusercontent.com/11017722/101611465-d6ee7300-3a09-11eb-8cc6-051e4b68455e.png">

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

posted by connor-baer over 4 years ago

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>
posted by kidonng over 4 years ago

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

image

posted by kidonng over 4 years ago

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.

posted by sindresorhus over 4 years ago

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.

posted by fregante over 4 years ago

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.

posted by kidonng over 4 years ago

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.

posted by cheap-glitch over 4 years ago

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.

posted by fregante over 4 years ago

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.

posted by fregante over 4 years ago

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.

posted by sindresorhus over 4 years ago

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

posted by sindresorhus over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests