Skip to content

Conversation

@Keerthi421
Copy link
Contributor

This PR improves the dark mode implementation by replacing the prebuilt cyborg theme with a custom dark theme and adding user controls. Key changes include:

  • Replaced Bootswatch cyborg theme with Bootstrap 5's native dark mode support
  • Added theme toggle button in navigation bar to override system preferences
  • Fixed contrast and readability issues in dark mode
  • Improved sidebar styling with better contrast and hover states
  • Added theme persistence using localStorage
  • Enhanced UI components (dropdowns, alerts, buttons) for dark mode

The changes address the issues mentioned in #110 regarding contrast problems, readability issues, and the need for a custom theme. The implementation now provides a more polished and user-friendly dark mode experience while maintaining consistency with Bootstrap 5's design system.

closes #110

@ChandlerSwift ChandlerSwift self-assigned this May 19, 2025

<script src="/static/js/jquery.slim.min.js"></script>
<script src="/static/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
Copy link
Member

Choose a reason for hiding this comment

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

We have made an effort to serve all scripts we're using from the application, rather than relying on external CDNs. Depending on your preference, I'd be happy to either see this file and the font file it references added to web/web/static, or since we only use two icons here, we could just inline two static SVGs for light and dark mode to avoid having to include an entire font.

@ChandlerSwift
Copy link
Member

In dark mode, the entries on the left side nav bar have light text on a light background:
image

@ChandlerSwift
Copy link
Member

In light mode, we've mostly lost the "active" list item indication, as well as have gained much darker separations between list items.

Before:
image

After:
image

@ChandlerSwift
Copy link
Member

This isn't a requirement for this PR, but the login page still respect light/dark mode.

@ChandlerSwift
Copy link
Member

The navbar has been made sticky and given a higher z-index, but doesn't have an opaque background so the text is visible below it. Personally, I don't think it's worth the screen real estate penalty to have the top nav sticky. (Side nav might be a different story!) Personally, I'd be lightly in favor of dropping the sticky top nav, though I could certainly be convinced otherwise!

Screencast_20250521_233226.webm

top: 0;
z-index: 1020;
background-color: var(--bs-body-bg);
transition: background-color 0.3s ease;
Copy link
Member

@ChandlerSwift ChandlerSwift May 22, 2025

Choose a reason for hiding this comment

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

This line makes the light/dark mode transition look a bit strange, IMO, since it's out of sync with the rest of the page on transition:
Screencast_20250521_233456.webm

@ChandlerSwift
Copy link
Member

Dark mode: Competition Statistics table uses dark text on dark background:
image

@ChandlerSwift
Copy link
Member

Same with other tables e.g.:
image
image
image
image

Copy link
Member

@ChandlerSwift ChandlerSwift left a comment

Choose a reason for hiding this comment

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

Please reach out ([email protected]) and let me know if you'd like a hand getting this set up for local testing! I'll concede it's not particularly straightforward :)

@ChandlerSwift ChandlerSwift mentioned this pull request Jul 5, 2025
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.

Refine Dark Mode

2 participants