Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#31259 closed New feature (fixed)

Add a dark theme to the admin module

Reported by: Michel Le Bihan Owned by: Michel Le Bihan
Component: contrib.admin Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: yes

Description

Hello,

Dark themes are becoming more and more popular after the introduction of prefers-color-scheme in browsers. There are many reasons for users to prefer a dark theme that are listed in multiple places.

Would it be possible for the admin module to have a dark theme? Is it in the scope of the project? If it is, I could try to add one.

Attachments (1)

Screenshot_2021-01-14 Select group to change Django site admin.png (41.8 KB ) - added by Florian Apolloner 3 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by Michel Le Bihan, 4 years ago

Owner: changed from nobody to Michel Le Bihan
Status: newassigned

comment:2 by Carlton Gibson, 4 years ago

Needs documentation: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Hi Michel, thanks for this.

Not a fan myself :) but prefers-color-scheme seems the way to go. Since you're keen to do the work, why not? :)

First step, I guess, is to get it working. (If you can post some screenshots to the PR, that helps folks get started.)

Then we just need to think about what docs (if any beyond a release note) we might want.

comment:3 by Carlton Gibson, 4 years ago

Summary: Please add a dark theme to the admin moduleAdd a dark theme to the admin module

comment:4 by Matthias Kestenholz, 4 years ago

I proposed starting to use CSS variables for styling the administration panel here: https://code.djangoproject.com/ticket/32018

I would hope that dark mode could be supported using something like

@media (prefers-color-scheme: dark) {
  html {
    --body-fg-color: #fff;
    --body-bg-color: #333;
  }
}

Maybe you have some feedback on the other ticket and/or the proposed change?

comment:5 by Carlton Gibson <carlton.gibson@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In b5cef91a:

Fixed #31259 -- Added admin dark theme.

comment:6 by Florian Apolloner, 3 years ago

Is this how it is supposed to look (see attachment). If yes, did people check the contrast ratios etc? The clear white of the checkboxes etc seem out of place to me as well as the heading in the sidebar.

comment:7 by GitHub <noreply@…>, 3 years ago

In 257dfce:

Refs #31259 -- Improved some color contrasts for admin dark theme.

comment:8 by GitHub <noreply@…>, 3 years ago

In f054468c:

Refs #31259 -- Made various dark theme adjustments.

comment:9 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In 4cf4c2df:

[3.2.x] Refs #31259 -- Made various dark theme adjustments.

Backport of f054468cac325e8d8fa4d5934b939b93242a3730 from master

comment:10 by Mariusz Felisiak, 3 years ago

KimSoungRyoul, please don't change descriptions of closed tickets. I removed your comment to restore the previous one.

in reply to:  10 comment:11 by KimSoungRyoul, 3 years ago

Replying to Mariusz Felisiak:

KimSoungRyoul, please don't change descriptions of closed tickets. I removed your comment to restore the previous one.

sorry to change descriptions

Note: See TracTickets for help on using tickets.
Back to Top