Skip to content

Conversation

UjjwalTomar0808
Copy link
Contributor

Description

This pull request resolves the issue of an inconsistent theme (dark/light mode) across the site. Previously, the about.html page had its own theme logic separate from the inline scripts on all other pages, causing the theme state to not be shared.
This has been fixed by:

  1. Creating a new, centralized assets/js/theme.js file to manage the theme state for the entire application.
  2. Removing the duplicate theme logic from assets/js/about.js.
  3. Removing the duplicated inline theme scripts from all other HTML pages (index.html, contact.html, faq.html, etc.).
  4. Updating all HTML files to use the single <script src="assets/js/theme.js"></script>.
    This change ensures a consistent user experience and improves code maintainability by adhering to the DRY (Don't Repeat Yourself) principle.

Closes #663

Type of change

  • [✅] Bug fix
  • New feature
  • Improvement
  • Documentation update

How Has This Been Tested?

I have tested this fix manually across multiple pages to ensure the theme state is now persistent and shared correctly.

  1. Loaded the homepage and switched the theme to dark mode.
  2. Navigated to the About page; it correctly loaded in dark mode.
  3. Navigated to the Contact page; it also correctly loaded in dark mode.
  4. Switched the theme back to light mode on the Contact page.
  5. Navigated back to the homepage and the About page; both correctly loaded in light mode.
    This confirms that the theme state is now successfully synchronized across all pages. Testing was performed on Chrome and Firefox.

Checklist:

  • [✅] My code follows the style guidelines of this project
  • [✅] I have performed a self-review of my code
  • [✅] I have commented my code where necessary
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@supriya46788 supriya46788 merged commit dd89e79 into supriya46788:main Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] "About" page maintains a separate theme context from the rest of the site

2 participants