Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge not in dark mode on initial page load with dark GitHub theme #1043

Closed
birkjernstrom opened this issue Aug 31, 2023 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@birkjernstrom
Copy link
Member

birkjernstrom commented Aug 31, 2023

I was using a single GitHub theme (Dark dimmed) and noticed that our badge remained in light mode on the initial page load of the issue; I hit refresh and it changed into dark mode. However, in the "Sync with system" mode it works without any issues on the initial page load.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog :^)
Fund with Polar
@birkjernstrom birkjernstrom added the bug Something isn't working label Aug 31, 2023
@birkjernstrom birkjernstrom moved this to Next in Polar Sep 3, 2023
@frankie567
Copy link
Member

frankie567 commented Sep 4, 2023

Can reproduce this consistently.

Dark dimmed theme (from navigation)

Here is the code output by GitHub when coming from another page (rendered in light mode):

<picture>
  <source media="not all" srcset="https://camo.githubusercontent.com/ea950ce09bdb3c96a90659c1a63877a380c0250011eccb0889085ef702435d2e/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e7376673f6461726b6d6f64653d31" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg?darkmode=1" class="source-dark source-light">
  <img alt="Fund with Polar" src="https://camo.githubusercontent.com/1c4d6c60fc8075ad4ee92ca9a73499ddf06be34dd9faadeea31fd8ddadf4ee92/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e737667" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg" style="visibility:visible;max-width:100%;">
</picture>

Dark dimmed theme (from page load)

Here is the code rendered on hard reload (rendered correctly in dark mode):

<picture>
  <source media="(prefers-color-scheme: light),(prefers-color-scheme: dark)" srcset="https://camo.githubusercontent.com/ea950ce09bdb3c96a90659c1a63877a380c0250011eccb0889085ef702435d2e/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e7376673f6461726b6d6f64653d31" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg?darkmode=1" class="source-dark">
  <img alt="Fund with Polar" src="https://camo.githubusercontent.com/1c4d6c60fc8075ad4ee92ca9a73499ddf06be34dd9faadeea31fd8ddadf4ee92/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e737667" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg" style="visibility:visible;max-width:100%;">
</picture>

OS synced theme

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://camo.githubusercontent.com/ea950ce09bdb3c96a90659c1a63877a380c0250011eccb0889085ef702435d2e/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e7376673f6461726b6d6f64653d31" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://camo.githubusercontent.com/1c4d6c60fc8075ad4ee92ca9a73499ddf06be34dd9faadeea31fd8ddadf4ee92/68747470733a2f2f706f6c61722e73682f6170692f6769746875622f706f6c6172736f757263652f706f6c61722f6973737565732f313034332f706c656467652e737667" data-canonical-src="https://polar.sh/api/github/polarsource/polar/issues/1043/pledge.svg" style="visibility:visible;max-width:100%;">
</picture>

It seems to generate the media query wrong not-all instead of (prefers-color-scheme: dark).

Needs more investigation, but starts to smell like a GitHub bug.

@frankie567
Copy link
Member

frankie567 commented Sep 4, 2023

I can confirm this happens with their official example in the docs:

Shows an illustrated sun in light color mode and a moon with stars in dark color mode.

People have reported similar issues here:

I'll also file our case there!

@birkjernstrom
Copy link
Member Author

Unfortunate, but not entirely unexpected given the bug behaviour. Good to know it's not on our end and hopefully they fix it in the near future.

@birkjernstrom birkjernstrom removed the status in Polar Sep 7, 2023
@birkjernstrom birkjernstrom changed the title Badge not in dark mode on initial page load with dark GitHub theme [POL-59] Badge not in dark mode on initial page load with dark GitHub theme Sep 27, 2023
@birkjernstrom birkjernstrom changed the title [POL-59] Badge not in dark mode on initial page load with dark GitHub theme Badge not in dark mode on initial page load with dark GitHub theme Sep 28, 2023
@zegl zegl closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
@github-project-automation github-project-automation bot moved this to Done in Polar Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants