question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Dark mode

See original GitHub issue

It is a really useful feature, that we can change the colors of the stats, but I would appreciate some sort of auto dark mode With dark mode coming to GitHub, I think it will have to be done sooner or later. Nat Friedman's hacker news profile

I have a couple of proposed solutions, but none of them seems perfect.

  1. If the auto theme is enabled, query a weather service such as The Open Weather API, to get the sunset time for the current timezone - I am not sure how to get the time zone though.

Example: client => Vercel <= Weather API

  1. It would be best if you could query the @prefers-color-scheme data of the browser, as no timezone or other preference data would be needed.

Query: https://github-readme-stats.vercel.app/api?username=anuraghazra&prefers=dark

  1. The hardest solution - we could contact GitHub directly, to perhaps provide a feature, to set alternative image sources according to the current theme.

Something like: [GitHub README stats]({dark: https://darkmodeurl}, light: https://lightmodeurl) in markdown

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:25 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
stale[bot]commented, Dec 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

4reactions
SukkaWcommented, Jul 25, 2020

@anuraghazra I will bring up my own test again.

<picture>
      <source 
        srcset="https://via.placeholder.com/1000x618.png?text=Dark+Mode"
        media="(prefers-color-scheme: dark)"
      />
      <source
        srcset="https://via.placeholder.com/1000x618.png?text=Light+Mode"
        media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
      />
      <img src="https://via.placeholder.com/1000x618.png?text=Fallback+Mode" />
</picture>
<picture> <source srcset="https://via.placeholder.com/1000x618.png?text=Dark+Mode" media="(prefers-color-scheme: dark)" /> <source srcset="https://via.placeholder.com/1000x618.png?text=Light+Mode" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" /> </picture>

Update

It appears that GitHub will transform the <picture> into simple <img>.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browse in Dark mode or Dark theme - Google Chrome Help
Note: This feature is called Dark mode on Desktop and Dark theme on mobile devices. When you browse in Dark mode or Dark...
Read more >
Dark theme - Android Developers
Dark theme applies to both the Android system UI and apps running on the device. ... Android 10 provides Force Dark, a feature...
Read more >
Blackout: How to Enable Dark Mode on Your Browser | PCMag
iOS: Go to Settings > Display & Brightness, then tap the Dark theme (or enable Auto to schedule when the feature should be...
Read more >
What Is Dark Mode And How To Turn It On Or Off - HP
Dark mode is a special screen setting designed to make the best use of dim light situations, particularly at night. Dark mode displays...
Read more >
Love dark mode? Here's why you may still want to avoid it
While there are some advantages of using dark mode, it may not be good for you. Here's why you may want to avoid...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found