-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adding Darkmode to graphiql #2146
Conversation
🦋 Changeset detectedLatest commit: 53aeed1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@harshitkumar31 thanks! Hoping to merge this soon - can you create a changeset as per the bot comment? |
also, can you add it to |
Codecov Report
@@ Coverage Diff @@
## main #2146 +/- ##
==========================================
- Coverage 65.70% 64.78% -0.93%
==========================================
Files 85 77 -8
Lines 5106 5188 +82
Branches 1631 1655 +24
==========================================
+ Hits 3355 3361 +6
- Misses 1747 1823 +76
Partials 4 4
Continue to review full report at Codecov.
|
looks great overall! again, thanks so much for this |
that was fast! |
Actually you know what - we might need to re-evaluate this strategy for 1.0 because it will invert |
@acao , Added a style to ensure images aren't inverted. |
thank you! looks great |
Hmmm... doc explorer font colors... I don't know... hmm! |
Hi, how you doing ? what should be changed? Can I help you? |
I don’t think the css filter invert() approach will work. It would be awesome if it did! This approach makes all the colors look off, and now the doc explorer might fail accessibility tests if dark mode is enabled because of the color contrast There is a css file someone posted on gist in that thread that should be fine with some tweaking, but make sure it works for query history as well in the new graphiql rfc as you can see we dont use CSS files, we use theme ui & emotion css, so you don’t have to worry about this working in 2.0 because we will use a different technique for accessing dark/light/solarized and other filtered theme modes, as well as user theme selection. User just provides a set of theme object literals. This is why we were waiting for 2.x to do this but no one is working on graphiql or has time |
I see. I don't have enough cycles or knowledge to implement the suggested changes. I'll close the PR, thanks. |
Well, you don’t need to close it in my opinion. I am glad to help you with this PR. I appreciate your initiative immensely, and a dark mode would be a great addition to wrap up 1.0 I completely forgot that a major part of this strategy should involve dynamically changing the codemirror theme as well! This would make the more manual CSS override approach more practical I think? |
It could be that we also get filter: invert() working where the doc explorer items look funky now (try doc search as well). Probably just a few more css selectors is all we need |
How about I create a new PR with your commit and my changes? That way you get credit for the original approach. I think we can make this work even if you don’t have time to finish. I think this will work out just fine! |
Sounds good. Thanks @acao |
As part of the designs for GraphiQL v2 we'll ship a dedicated dark mode implementation, for updates see #2328. I'm closing this PR in favor of the upcoming dark mode implementation. Thanks for everyone contributing here! ❤️ |
Addresses #129