Repository navigation
Conversation
- Improve contrast for query count (.numrows) and inline filter buttons - Fix text and link contrast for breadcrumbs (#pagepath) and search buttons - Enhance admin sidebar navigation (#tabs) active states and subheadings - Correct contrast for missing/forbidden indicators in table rows
sabderemane
left a comment
There was a problem hiding this comment.
Hey @kehach07 ! This is close! It's missing the last changes and we are good to go ⭐
If there are anything else after that, I think it could be fixed in another PR while this one is merged.
…de blocks - Ensure readable dark text on foldable pill buttons and hover states - Standardize muted text and alternate format links to #9f9d9d - Improve ticket code blocks and timeline/comment indicators
jacobtylerwalls
left a comment
There was a problem hiding this comment.
Thanks for waiting so patiently for a review @kehach07!
I'm looking forward to trying this out. (I was on a plane recently, and the cabin lights were dimmed. Upon opening my laptop, Trac happened to be open, and the light mode burned the retinas of everyone around me, so this will definitely be a welcome improvement!)
I did a preliminary smoke test and had a couple questions. I'd like to look at the code a little more closely, but I'm glad to see @sabderemane has already done a through review. 🙌
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Improve code block background and diff table contrast in dark mode - Respect user Pygments syntax themes without token override collisions - Remove redundant tracdjangoplugin installation check in entrypoint script
jacobtylerwalls
left a comment
There was a problem hiding this comment.
Thanks for the updates @kehach07! These are my last comments, and then my plan is to deploy your branch to the preview server.
A few last contrast issues I noticed below. (If you can't easily find the steps to navigate to these pages, just say so and I'll provide step-by-step notes.)
I marked a couple as "minor" that I would be comfortable "futuring". @sabderemane if you think there are some more we should bounce to a new ticket, let me know, I don't want to extend the scope of this project unreasonably 👍
Both modes:
- When focused, button text:
Light mode:
- When focused, the text "-" inside the icon on the filter removal button
Dark mode:
- Comment preview box (see gray text, also dark mode ignored)
- Highlighted text in input fields:
- Search result titles (blue on black):
- Search result highlighting after selecting a result (ticket page) (gray on yellow):
- The inline diff toggle appears reversed -- this screenshot shows the "tabular" view, but it looks like "unified" has more emphasis
- [minor:] Ticket confirmation banner: ticket number before "has been created"
- [minor:] "Paste an image to attach"
| ========================================================================== */ | ||
| /* ========================================================================== | ||
| 1. Light Theme & Base Scope | ||
| Fixes Jacob's "light gray on beige" issue in light mode |
There was a problem hiding this comment.
You don't need to refer to me in the file :-)
|
|
||
| html[data-theme="dark"] #tabs, | ||
| html[data-theme="dark"] div#tabs, | ||
| @media (prefers-color-scheme: dark) { |
There was a problem hiding this comment.
My IDE highlights this as invalid syntax ("selector expected"). I don't think a media query can follow a list of selectors.
There are a couple others in this file (are they dead code?)
There was a problem hiding this comment.
I agree, selectors should be inside the media query or a separate rule identical to the media query, so they both applies the same thing. I guess the rule is skipped in that case yeah 🤔
|
@jacobtylerwalls makes sense to me, any new thing spotted could be a new ticket, so we can merge this work, it would be a good addition first ⭐ |
|
I put these changes on the preview branch (plus some cosmetic edits) as shown here. You can check https://code.preview.djangoproject.com/
|
Thanks for the feedback! I’ll check the preview and work on fixing the issues. Appreciate your help! |
|
Hi @jacobtylerwalls, I've pushed the latest changes in edfe56f covering all the contrast and CSS issues we discussed. Please let me know if anything else needs attention! |
Summary
This draft PR introduces dark mode support and theme toggle functionality to Django's Trac instance (
code.djangoproject.com), aligning its design, color tokens, and toggle behavior with the maindjangoproject.comwebsite.Work done under Google Summer of Code (GSoC) 2026 with the Django Software Foundation.
Key Changes
AutoLightDark) matching the upstream toggle behavior on the main Django website.trac-env/templates/site_header.htmlandsite_head.htmlto inject theme markup, include accessibility hooks, and load dark mode scripts.scss/trachacks.scssanddarkmode.csswith clean CSS custom properties for surfaces, borders, ticket tables, query builders, and admin views.aria-label, visible focus outlines, and compliant.visually-hiddenstyling) and fixed contrast ratios across key pages.README.rstanddocker-entrypoint.shfor smoother static asset builds and local plugin registration checks.Testing & Verification
prefers-color-scheme)./query,/ticket, and/admin.Related Links & References