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

feat: add dark mode for website #2650

Closed
wants to merge 16 commits into from

Conversation

vishvamsinh28
Copy link
Contributor

This PR adds Dark Mode functionality, enhancing user experience with an alternative color scheme for better readability in low-light environments. It includes a toggle button for seamless theme switching.

resolves #1269

Copy link

netlify bot commented Feb 11, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5865472
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/65cc0aa50bc88b0008befde1
😎 Deploy Preview https://deploy-preview-2650--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@anshgoyalevil
Copy link
Member

Thanks for this @vishvamsinh28 but we aren't considering the PRs related to the issue #1269 since it is now a part of the GSoC'24 Idea https://github.com/postman-open-technologies/gsoc-2024/issues/8

@derberg
Copy link
Member

derberg commented Feb 12, 2024

@anshgoyalevil this was not mentioned in the issue. We should always make sure that plans are transparent with others so people do not waste time. GSoC is like in 4 months, does this PR really have to wait? if work is that advanced. I don't see this PR helping solve the messy situation we have in the project 🤔

@anshgoyalevil
Copy link
Member

anshgoyalevil commented Feb 13, 2024

@derberg
Yes, I agree with you. I too previously didn't know it was a part of https://github.com/postman-open-technologies/gsoc-2024/issues/8 GSoC idea when I asked @vishvamsinh28 to work on #1269

Later I was told that "the project idea https://github.com/postman-open-technologies/gsoc-2024/issues/8 is somewhat small according to the timeline, and can accommodate the Dark mode issue too"

Though I agree with you about explicitly mentioning this upstream issue in the GSoC idea description.
//@AceTheCreator @akshatnema

@akshatnema
Copy link
Member

@anshgoyalevil this was not mentioned in the issue. We should always make sure that plans are transparent with others so people do not waste time.

Yeah, I asked @AceTheCreator to update the issue with more context and information. I'm not sure if he has done it or not.

Regarding this PR, I'm not sure if it is helpful or not because PR itself is failing at build. @vishvamsinh28 will have to fix the bugs if we continues with this PR.

@vishvamsinh28
Copy link
Contributor Author

@anshgoyalevil this was not mentioned in the issue. We should always make sure that plans are transparent with others so people do not waste time.

Yeah, I asked @AceTheCreator to update the issue with more context and information. I'm not sure if he has done it or not.

Regarding this PR, I'm not sure if it is helpful or not because PR itself is failing at build. @vishvamsinh28 will have to fix the bugs if we continues with this PR.

@akshatnema I'll fix it

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Feb 13, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 33
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-2650--asyncapi-website.netlify.app/

@vishvamsinh28
Copy link
Contributor Author

@akshatnema @anshgoyalevil @derberg build fixed please review the pr

@derberg derberg changed the title feat: added dark mode for website feat: add dark mode for website Feb 13, 2024
@derberg
Copy link
Member

derberg commented Feb 13, 2024

If we have it already open I don't see the point of waiting for GSoC. If not this, other things can be added to whatever topic you have there - but this should be done in a transparent way, as comment in the issue that is picked for GSoC, not somewhere inside postman GH org

Copy link
Member

@anshgoyalevil anshgoyalevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The changes look neat. There are some areas that need improvements like the tools/cli.

You can create incremental PRs.
For example,

  • You can comment out the Dark Mode toggle so that we (as the reviewers) can un-comment it locally and test the changes. This would ensure that dark mode is not accessible to end users as of now. This would also ensure we don't push a large code change to production.
  • After that, you can create PRs for each page, or some pages like all tools pages, or the homepage, etc. This would help us in reviewing as at that time we would know which page to look for.

@quetzalliwrites
Copy link
Member

DOCS bugs with current dark mode

1) 🟪 On the docs homepage, the text in the content bucket cards is too dark to read.

2) 🟩 The MIGRATION favicon in the left-hand navigation is too dark to be seen.

Screenshot 2024-02-13 at 4 36 43 PM

3) Throughout the docs, several text sections are now either too dark 🟩 or too light 🟦 , making a subpar reading experience.

Screenshot 2024-02-13 at 4 39 21 PM Screenshot 2024-02-13 at 4 55 53 PM

4) 🟪 When unselected, the homepage favicon in the left-hand navigation is too dark and cannot be seen.

5) 🟩 When selected, the remaining favicons are too light and cannot be seen clearly against the pastel background colors.

Screenshot 2024-02-13 at 4 44 39 PM

6) 🟩 Adding a grey background box to the docs Table of Contents (TOC) is too heavy-handed and distracting. I would remove it altogether.

Screenshot 2024-02-13 at 4 47 24 PM

7) 🟩 Unfortunately, all mermaid diagrams are affected by the current dark mode; you cannot see any of the arrows.

Screenshot 2024-02-13 at 4 57 15 PM

Copy link
Member

@quetzalliwrites quetzalliwrites left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a substantial amount of bugs to fix before this is anywhere ready to merge 😸

@vishvamsinh28
Copy link
Contributor Author

Since there are still bugs to fix in this PR and it has over 60+ files changed, it's hard for even maintainers to review this many files.

So, as Ansh suggested, I'm thinking of making incremental changes. I'll comment out the dark mode toggle button until the final PR, so maintainers can uncomment it and test the changes locally before the final PR.

I'm waiting for Maya's review on this PR; she can provide a good color combination for the areas where the background color and content aren't in good sync.

Wdyt ?

@derberg @akshatnema @anshgoyalevil @Mayaleeeee

@derberg
Copy link
Member

derberg commented Feb 15, 2024

@vishvamsinh28 I love the suggestion from @anshgoyalevil

small incremental changes + no need for feature branch ❤️

to make it easier for others to review and provide feedback, you can even add a feature flag that enables dark mode by default. So if I add ?darkmode=true or ?darkmode anywhere to the URL, like https://www.asyncapi.com/docs/tools/generator?darkmode, then I get dark mode enabled.

if you decide to do it this way, you can see how easy it is to parse URL query params as we do it already in tools section -> https://www.asyncapi.com/tools?owned=true&langs=TypeScript

Copy link
Member

I'm just commenting to give this visibility again, I was curious to see where we landed 😺

@vishvamsinh28
Copy link
Contributor Author

@alequetzalli We are migrating the website from JavaScript to TypeScript, so I'm busy working on its PRs. I'm planning to work on this after the migration is completed, but I'll definitely complete the Dark Mode PR. 😁

Copy link
Member

woot woot and best of luck 🍀

@sambhavgupta0705
Copy link
Member

@vishvamsinh28 what's the status?

@vishvamsinh28
Copy link
Contributor Author

vishvamsinh28 commented Jul 10, 2024

@sambhavgupta0705 I'm currently busy with my gsoc project so most likely i will start working on it after gsoc if someone is not working on it

@sagarkori143 you start working on it if your interested since I'm busy with gsoc you can refer this PR because I have completed more then 50% of work with this PR I only need to fix some bugs you can have a look at reviews done by maintainers above also as Ansh suggested make incremental changes

@sambhavgupta0705
Copy link
Member

OK @sagarkori143 you can start working on this

@sambhavgupta0705
Copy link
Member

Closing this as unplanned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark/Light Mode Button
7 participants