Implemented a production-ready global dark mode system for the DevPath application#160
Implemented a production-ready global dark mode system for the DevPath application#160DelacroixAD wants to merge 7 commits into
Conversation
|
@DelacroixAD is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds a global dark-mode system to the Flask-based DevPath site: a synchronous anti-FOUC bootstrap in each template, persistent localStorage preference with prefers-color-scheme fallback, accessible desktop + mobile toggle buttons, dark-mode CSS variable overrides, and component-specific contrast adjustments.
Changes:
- Introduce
html[data-theme="dark"]variable overrides plus component-specific dark-mode rules and a toggle-button style instatic/style.css. - Add a self-contained theme engine (
initTheme/applyTheme, delegated click handler, screen-reader announcement region) tostatic/script.js, plusaria-expandedpolish on the mobile-nav handler. - Add accessible toggle buttons (desktop + mobile) and a duplicated anti-FOUC inline script to
templates/index.html,templates/project.html, andtemplates/404.html; project.html also gains the previously missing mobile menu.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| static/style.css | Dark-mode variable theme + toggle button styles + per-component dark overrides; contains an unclosed comment that breaks the toggle styling and the promised smooth-transition rule, plus unreadable .hvc-title/.hvc-sub overrides. |
| static/script.js | New theme engine with persistence and ARIA syncing; references a .theme-ready class that has no CSS counterpart. |
| templates/index.html | Adds anti-FOUC script, desktop + mobile theme toggles, and aria-* on nav; mobile toggle inherits nav-mobile-link so the menu auto-closes on click. |
| templates/project.html | Adds anti-FOUC script, mobile menu, and desktop/mobile theme toggles; same mobile auto-close issue and duplicated inline script. |
| templates/404.html | Adds anti-FOUC script and desktop theme toggle to the 404 navbar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@DelacroixAD do resolve the merge conflicts before merging |
|
@komalharshita Merge conflicts have been resolved and the branch has been updated. Please review when convenient. Thank you! |
Summary [required]
Implemented a production-ready global dark mode system across the DevPath application with accessibility and responsive support. The update includes persistent theme storage using localStorage, automatic OS theme detection via prefers-color-scheme, smooth theme transitions, improved dark mode contrast, and accessible toggle controls for both desktop and mobile navigation.
Related Issue [required]
Closes #106
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
static/style.cssstatic/script.jstemplates/index.htmltemplates/project.htmltemplates/404.htmlHow to Test This PR [required]
git checkout your-branch-namepip install -r requirements.txtpython app.pypython tests/test_basic.pyExpected test output:
Test Results [required]
Screenshots (if UI change)
Homepage - Light Mode
Homepage - Dark Mode
Mobile Navbar
Project Detail Page
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
Focused on keeping the implementation minimal and compatible with the existing Flask structure while improving accessibility, responsiveness, and dark mode readability.