Skip to content

Added light mode feature with toggle button and localStorage support. #8

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sameermuslim
Copy link

Light Mode Feature: Implemented a light mode feature in the project, providing users with the ability to toggle between light and dark modes.

Toggle Button: Added a toggle button (mode-toggle-btn) for seamless switching between light and dark modes. The button ensures a user-friendly experience.

LocalStorage Integration: Utilized localStorage functionality to remember the user's last activated mode, enhancing user convenience across sessions.

CSS Modifications (style.css):

Introduced a new CSS class, .light-mode, to facilitate styling for the light mode.
Duplicated and modified variables present in ::root to accommodate the unique styling requirements of the light mode.
Added new variables in both :root and .light-mode, resolving conflicts and ensuring a harmonious visual experience.

HTML Enhancements (index.html):

Included all SVGs directly within the HTML file, enabling dynamic color changes based on the selected mode.
Added a

element with the class mode-toggle-btn inside the tag.

JavaScript Functionality (script.js):

Implemented functionality for the mode-toggle-btn, ensuring a smooth transition between light and dark modes.
Integrated localStorage utility to store and retrieve the user's mode preference for a personalized experience.

Image Assets (images directory):

Added two icons, moon.svg and sun.svg, to the images directory for use in the toggle button.

Responsiveness:

Ensured the code is responsive, providing a consistent user experience across various screen sizes.

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.

1 participant