Skip to content

fix: resolve theme toggle inconsistency across dashboard pages#1700

Merged
omroy07 merged 1 commit intoomroy07:mainfrom
nur-hasin:fix/theme-toggle-consistency-dashboard-pages
Mar 6, 2026
Merged

fix: resolve theme toggle inconsistency across dashboard pages#1700
omroy07 merged 1 commit intoomroy07:mainfrom
nur-hasin:fix/theme-toggle-consistency-dashboard-pages

Conversation

@nur-hasin
Copy link
Copy Markdown
Contributor

@nur-hasin nur-hasin commented Mar 5, 2026

Which issue does this PR close?

Rationale for this change

The theme toggle button was unresponsive or visually broken across multiple dashboard pages. Root causes identified:

  • Cursor trail overlay (.circle-container / .cursor-circle) intercepting pointer events and blocking clicks on #themeToggle
  • Pages using conflicting theme systems (body.dark-mode class vs data-theme attribute)
  • Duplicate click listeners cancelling each other out
  • Old toggleTheme() functions in page-specific JS overriding theme.js
  • SVG ray <line> elements inside the toggle button intercepting clicks before they reached the button

What changes are included in this PR?

  • Added pointer-events: none to .scroll-indicator, .circle-container and .cursor-circle to prevent overlay elements from blocking button clicks
  • Added pointer-events: none to theme toggle SVG so ray lines no longer intercept clicks
  • Removed duplicate/conflicting toggleTheme() and initializeTheme() functions from app_scheme.js
  • Replaced body.dark-mode CSS rules with [data-theme="dark"] selectors in styles_scheme.css to match the unified theme.js system
  • Added ../theme.js to pages that were missing it (Gov_schemes/index_scheme.html)
  • Removed inline style="position:fixed" from toggle button in main.html navbar
  • Applied consistent sun/moon SVG toggle button across all affected pages

Are these changes tested?

Manually tested on all pages in both light and dark mode:

  • Verified toggle switches theme on click
  • Verified background and card colors change on toggle
  • Verified theme persists on page reload via localStorage
  • Verified cursor trail no longer blocks button clicks
  • Verified no overlay elements block the toggle button
  • Tested on Chrome, Firefox, and Edge

Are there any user-facing changes?

Yes - the theme toggle button now correctly switches between light and dark mode on all dashboard pages with smooth sun/moon animation. No visual or layout changes were made.

Screenshots

Screenshot 2026-03-04 080109 Screenshot 2026-03-04 075944 Screenshot 2026-03-04 080015 Screenshot 2026-03-05 042207 Screenshot 2026-03-04 080127 Screenshot 2026-03-04 080211 Screenshot 2026-03-04 080236 Screenshot 2026-03-04 081214 Screenshot 2026-03-04 081231 Screenshot 2026-03-04 084149 Screenshot 2026-03-04 084208 Screenshot 2026-03-05 025410 Screenshot 2026-03-05 025449 Screenshot 2026-03-05 025959 Screenshot 2026-03-05 030021 Screenshot 2026-03-05 110757 Screenshot 2026-03-05 042233 Screenshot 2026-03-05 102228 Screenshot 2026-03-05 102250 Screenshot 2026-03-05 110738

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

@nur-hasin is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

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. 🙌🏼

@nur-hasin
Copy link
Copy Markdown
Contributor Author

nur-hasin commented Mar 5, 2026

Hi @omroy07, kindly review and merge if approved. Let me know if any changes are required. Thanks.

@omroy07 omroy07 merged commit 11954f0 into omroy07:main Mar 6, 2026
2 of 5 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

🎉 Congrats @nur-hasin on getting your PR merged! 🙌
Thanks for the contribution — looking forward to more from you 🚀

@nur-hasin
Copy link
Copy Markdown
Contributor Author

nur-hasin commented Mar 6, 2026

Hi @omroy07, kindly add the ECWoC26 SPRINT label to this PR. It is necessary for points to be added.

@nur-hasin
Copy link
Copy Markdown
Contributor Author

Hi @omroy07, kind reminder - I'd requested the ECWoC26 SPRINT label earlier. Please add it so points can be counted. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: theme toggle not functioning correctly & button UI inconsistent across multiple dashboard pages

2 participants