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

refactor: encapsulate theme setting logic into functions 🪄✨ #693

Open
0xabdulkhaliq opened this issue Aug 6, 2023 · 2 comments
Open
Assignees
Labels
enhancement New feature or request gssoc23

Comments

@0xabdulkhaliq
Copy link
Contributor

Description:

  • The purpose of this issue is to enhance the Dark Mode functionality in the Code Set Go project. The current implementation of the dark mode logic can be improved for better maintainability and readability.
  • The code for toggling between light and dark mode can be optimized and organized in a more structured manner.

Proposed Changes:

  1. Encapsulate the dark mode logic into functions: The existing code will be refactored to encapsulate the theme setting logic into functions. This will improve the readability and make the code easier to understand.

  2. Use constants for theme values: Instead of using hard-coded theme strings, we will introduce constants for the theme values to avoid repetition and enhance code clarity.

  3. Optimize code for setting and toggling themes: The functions will be designed to handle setting the appropriate class and updating UI elements based on the selected theme. The toggleTheme() function will be responsible for toggling between light and dark mode.

  4. Improve theme initialization: The theme initialization process will be streamlined to handle user preferences or default to the dark theme if no preference is found.

Expected Benefits:

  • Improved code organization and readability.
  • Enhanced maintainability and easier future updates.
  • Consistent and optimized handling of theme changes.
  • Better user experience with a more reliable and intuitive dark mode functionality.
@0xabdulkhaliq
Copy link
Contributor Author

Hey there @agamjotsingh18 👋🏻

Please make sure to assign this issue to me to make the work done, Thank You!

@agamjotsingh18
Copy link
Owner

agamjotsingh18 commented Aug 8, 2023

Sure @0xabdulkhalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc23
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants