dharmendrarajak / My-Portfolio

0 stars 0 forks source link

feat. Add Dark Mode Toggle Feature #1

Open Prem294 opened 1 month ago

Prem294 commented 1 month ago

We need to implement a dark mode toggle feature for the portfolio website of Dharmendra Rajak . This feature will allow users to switch between light and dark themes, enhancing user experience and accessibility.

Current Behavior: Currently, the website only supports a light mode interface. Users do not have the option to switch to dark mode, which can be more comfortable for viewing in low-light conditions.

Proposed Solution:

  1. Dark Mode Styles: Create a new CSS class (.dark-mode) that will modify the colors of the background, text, and other UI elements to suit a dark theme. Ensure all sections (header, hero, about, work, contact, footer) have corresponding dark mode styles.

  2. Toggle Button: Add a toggle button in the header that allows users to switch between light and dark modes. Implement JavaScript to handle the toggle functionality: On click, toggle the .dark-mode class on the element. Store the user’s preference in local Storage so that the selected theme persists across page reloads.

  3. Accessibility Considerations: Ensure that the contrast ratio between background and text in dark mode is sufficient for readability. Test the implementation for usability and aesthetic consistency.

Acceptance Criteria: A toggle button is visible and functional in the header. The website switches between light and dark themes upon toggling. User’s theme preference persists across sessions. All UI elements are styled correctly in both modes.

Additional Context: Refer to similar implementations in other websites for inspiration. Consider user feedback on preferences for theme options.

Prem294 commented 1 month ago

I can take care of implementing the dark mode toggle feature. I'll work on creating the necessary styles for dark mode, adding the toggle button, and ensuring that user preferences are stored. I’ll keep everyone updated on my progress !