Skip to content

Add a dark theme toggle #57

@Aditya8369

Description

@Aditya8369

Description
No light/dark theme toggle exists in main site.

Plan
1.style.css:

  • Add :root CSS vars for light theme (extract existing colors, e.g., --bg-gradient: linear-gradient(135deg, #fdf6f0, #f8e8ee, #e4f0f6);, --text-primary: #5c5470;, --accent: #ff86ba;, --glass-bg: rgba(255,255,255,0.6); etc. ~20 vars covering bg/text/buttons/shadows/gradients).
  • Replace hardcoded colors with vars throughout (body, header, cards, footer, hover states, animations).
  • Add body.dark block overriding vars to dark theme (e.g., --bg-gradient: linear-gradient(135deg, #1a0f2e, #2a1b3d, #3a254a);, dark glass: rgba(20,15,35,0.8);, light text).
  • Update media queries/transitions for theme-aware smooth switches.

2.script.js:

  • Add theme toggle function: toggleTheme() – checks localStorage/prefer-color-scheme, toggles document.body.classList.toggle('dark'), saves to localStorage.
  • Init on load: initTheme() reads localStorage or system pref, applies class.
  • Add toggle button listener (new ID #theme-toggle).
  • Preserve existing nav/animations.

3.index.html (representative; apply to other main HTMLs via search/edit if needed):

  • Add toggle button in .nav-profile: ☀️🌙.

4.auth.css:

  • Similar to style.css: Add CSS vars (matching main), replace hardcoded colors, body.dark overrides (dark auth glassmorphism).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestjwocThis project is under jwoc

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions