Skip to content

Conversation

@AmanKashyap0807
Copy link

Description

This PR implements a dark/light mode toggle for the Writers Program website, enhancing accessibility and modern UI standards.

Related Issue

Fixes #3075

What I implemented

  • Enabled class-based dark/light mode using Tailwind’s class strategy (see [tailwind.config.js].
  • Added a theme toggle UI (CSS class .header-theme-toggle) in header.
  • Implemented site-wide dark-mode overrides scoped under the .dark namespace to preserve Keploy brand colors while improving contrast for readability (header, menu icon, home, home-social, footer, inputs, buttons, contact, etc.) — see [main.css].
  • User choice is saved to localStorage and re-applied on page load so dark/light selection survives reloads and navigation.
  • I used a simple native (aria-pressed + keyboard handlers) and a tiny JS module to toggle the top-level .dark class and save the choice to localStorage. ( This keeps the site dependency‑free, small while still meeting accessibility needs.
  • The bunny graphic originally had a white background, which looked off in dark mode. I used photo editing tools to make the image background transparent so it fits visually in both modes.

Acceptance Criteria Checklist

  • Toggle button is visible and accessible.
01 Screenshot 2025-11-03 232035

Open to Feedback

If you’d like this implemented differently (e.g., toggle position, style), let me know—I can update it as per your suggestions!

Thanks

Thank you for your time in reviewing this contribution! Looking forward to feedback and suggestions.

Copilot AI review requested due to automatic review settings November 3, 2025 18:16
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you and congratulations 🎉 for opening your very first pull request in writers-program

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a dark mode theme toggle feature for the Keploy contribution website using Tailwind CSS. The implementation includes a theme toggle button, dark mode styles, and various UI improvements.

Key Changes:

  • Added Tailwind CSS configuration and PostCSS build pipeline for generating theme utilities
  • Implemented a theme toggle button with localStorage persistence and keyboard accessibility
  • Updated footer styling with improved newsletter input design and horizontal social icons layout

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tailwind.config.js New Tailwind configuration with Keploy brand colors and dark mode class strategy
postcss.config.js PostCSS configuration for Tailwind and autoprefixer processing
package.json Added build scripts and dependencies for Tailwind CSS, PostCSS, and autoprefixer
js/theme-toggle.js New JavaScript module handling theme toggle logic with localStorage and keyboard support
css/tailwind.css Tailwind directives and custom dark mode styles for various UI sections
css/tw.css Generated Tailwind utility classes and dark mode overrides
css/main.css Refactored header controls, theme toggle button styles, and footer component styling
index.html Added theme toggle button, updated bunny image, integrated Tailwind CSS, and changed newsletter icon
styles.html Added theme toggle button and integrated Tailwind CSS with cache-busting parameters
Comments suppressed due to low confidence (1)

index.html:260

  • Corrected spelling of 'Prorgam' to 'Program'.
              <h3> An Open-Source Prorgam for Students, Professionals, and Freelancers</h3>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
@tailwind components;
@tailwind utilities;
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Missing @tailwind base; directive. Tailwind CSS typically requires all three directives (base, components, utilities) for proper functionality. Without the base layer, CSS resets and default styles won't be applied, which may lead to inconsistent styling across browsers.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +32
<link rel="stylesheet" href="css/main.css?v=dlm2">
<link rel="stylesheet" href="css/tw.css?v=dlm2">
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Cache-busting version parameters are inconsistent between index.html (v=dlm2) and styles.html (v=dlm1). Consider using a consistent versioning strategy across all HTML files or implementing a build-time variable to maintain synchronization.

Copilot uses AI. Check for mistakes.
css/main.css Outdated

/* When dark theme is active, don't show the opaque white chip — keep it transparent/dark */
.dark .header-menu-toggle.opaque {
background-color: rgba(255,255,255,0.0); /* subtle translucent so it doesn't pop as white */
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Using rgba(255,255,255,0.0) is unnecessarily verbose for a fully transparent background. Use transparent instead for better readability and maintainability.

Suggested change
background-color: rgba(255,255,255,0.0); /* subtle translucent so it doesn't pop as white */
background-color: transparent; /* subtle translucent so it doesn't pop as white */

Copilot uses AI. Check for mistakes.
package.json Outdated
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build:css": "npx postcss css/tailwind.css -o css/main.css",
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The build:css script outputs to css/main.css, which will overwrite the existing main.css file that contains custom styles. This appears to be a mistake since build:tw correctly outputs to css/tw.css. The build:css script should likely be removed or renamed to avoid confusion and prevent accidental overwriting of main.css.

Suggested change
"build:css": "npx postcss css/tailwind.css -o css/main.css",

Copilot uses AI. Check for mistakes.
align-items: center;
justify-content: center;
position: absolute;
top: 33%;
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The submit button positioning uses top: 33% with transform: translateY(-50%), resulting in a final vertical position of approximately 8% from the top. This appears incorrect for centering the button vertically within the input field. Change top: 33% to top: 50% for proper vertical centering.

Suggested change
top: 33%;
top: 50%;

Copilot uses AI. Check for mistakes.
@amaan-bhati amaan-bhati self-requested a review November 25, 2025 18:03
Copy link
Member

@amaan-bhati amaan-bhati left a comment

Choose a reason for hiding this comment

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

Hey @AmanKashyap0807 Thanks for raising this pr, can you please provide a preview in forn of a video for the whole page. Also, please take a look at the copilot review added in the pr.

@AmanKashyap0807
Copy link
Author

AmanKashyap0807 commented Dec 16, 2025 via email

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants