Skip to content

feat: fix light/dark mode toggle (#954)#990

Closed
shravanithouta108 wants to merge 1 commit into
utksh1:mainfrom
shravanithouta108:feat/light-dark-mode-toggle
Closed

feat: fix light/dark mode toggle (#954)#990
shravanithouta108 wants to merge 1 commit into
utksh1:mainfrom
shravanithouta108:feat/light-dark-mode-toggle

Conversation

@shravanithouta108

Copy link
Copy Markdown
Contributor

Description

The light/dark mode toggle button existed in the UI but clicking it had no effect. The ThemeContext and ThemeToggle components were already implemented correctly, but the theme switching was not working because the Tailwind and CSS configuration was incomplete.

Root causes fixed:

  1. tailwind.config.js was missing darkMode: 'class' — Tailwind was ignoring the dark class added by ThemeContext to the HTML element
  2. .theme-light CSS variable overrides were missing from index.css — switching to light mode had no visual effect
  3. bg-secondary, bg-primary, bg-tertiary color classes were not mapped to CSS variables in Tailwind config — components were not responding to theme changes

Related Issues

Closes #954

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  1. Click the toggle button in the sidebar — UI switches between dark and light themes
  2. Verify the button icon updates (sun ☀️ for light mode, moon 🌙 for dark mode)
  3. Refresh the page — selected theme persists via localStorage
  4. Clear localStorage — app falls back to OS system preference

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@shravanithouta108

Copy link
Copy Markdown
Contributor Author

Hi @utksh1 — the frontend-checks failure is the pre-existing vite vulnerability (GHSA-fx2h-pf6j-xcff) on main — the same one blocking PR #646. This PR only modifies tailwind.config.js and index.css with no dependency changes. Could you add the vite exception to .audit-config.yaml on main so both PRs can be evaluated?

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I can’t merge this as-is: it only adds CSS/theme tokens and Tailwind color aliases, but it does not wire the application’s actual light/dark mode toggle behavior, and frontend-checks are failing on this PR. Please connect the theme state/toggle path end-to-end and get the frontend check green.

@utksh1 utksh1 added the gssoc:invalid Admin validation: invalid for GSSoC scoring label Jun 16, 2026
@utksh1

utksh1 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Closing this because it is marked gssoc:invalid after review. Please open a fresh, focused PR if you want to submit a corrected version.

@utksh1 utksh1 closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:invalid Admin validation: invalid for GSSoC scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Fix light/dark mode button

2 participants