[Django] #33690: Allow disabling admin module dark theme

412 views
Skip to first unread message

Django

unread,
May 10, 2022, 3:32:55 AM5/10/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-----------------------------------------+----------------------------
Reporter: nv35 | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Keywords: dark theme
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-----------------------------------------+----------------------------
Since #31259, dark theme had been added to admin interface and enabled by
default to follow OS environment theme.
Some sites may want to have the possibility to keep the light theme for
all users, ie. for compatibility with custom forms/views/charts... that
don't render well under dark theme.
Having possibility to disable dark theme for the whole admin site would be
a good start.

There are already some stackoverflow questions about that, and multiple
django plugins to do that. They basically just force light theme in css,
while a more evolved one stores user preference in database.
https://stackoverflow.com/questions/67193106/disable-prefers-color-scheme-
dark-in-django-admin
https://stackoverflow.com/questions/68159768/disable-dark-mode-in-django-
admin
https://pypi.org/project/django-non-dark-admin/
https://pypi.org/project/django-light/

--
Ticket URL: <https://code.djangoproject.com/ticket/33690>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 10, 2022, 4:05:06 AM5/10/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------+------------------------------------

Reporter: nv35 | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by Carlton Gibson):

* cc: Sarah Abderemane, jefftriplett (added)
* stage: Unreviewed => Accepted


Comment:

This keeps coming up so we should likely accept the change here.

There's a related PR for djangoproject.com
https://github.com/django/djangoproject.com/pull/1158 — whatever switch we
develop for there should be applied here too.

There was some discussion on Twitter where the consensus seemed to be to
Follow the system setting, but allow an override — that should guide
implementation.
(e.g. https://twitter.com/webology/status/1514760882605109276)

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:1>

Django

unread,
May 10, 2022, 4:56:38 AM5/10/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Abderemane):

* owner: nobody => Sarah Abderemane
* status: new => assigned


Comment:

I have done that on the related PR, it's taking the default os preference
and there is a button to force the switch over system preference. I just
need to do some improvements suggested in the PR.

I add the user preference in the local storage for djangoproject.com but
for the admin it can be in the database or same as djangoproject.com, in
local storage or other suggestion.
What do you think ?

As the admin has already a dark theme, I can handle it, before the change
for djangoproject.com and adjust if needed.

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:2>

Django

unread,
May 11, 2022, 3:43:58 AM5/11/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hi Sarah. I think local storage is fine (great even). Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:3>

Django

unread,
May 11, 2022, 4:02:46 AM5/11/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by nv35):

Hi, thanks for your replies. I guess there are 2 different features that
are missing :
- possibility to disable dark theme completely on a site
- give the user the possibility to switch between dark and light, and
store the choice
I've created ticket initially for the first one, perhaps a second ticket
have to be created for the other? Thanks

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:4>

Django

unread,
May 29, 2022, 9:05:37 AM5/29/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Florian Demmer):

* cc: Florian Demmer (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:5>

Django

unread,
Jun 14, 2022, 7:18:00 PM6/14/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Sarah Abderemane):

Hi nv35,


> I've created ticket initially for the first one, perhaps a second ticket
have to be created for the other?

No need to create another ticket, in my opinion, it's only the fact that
your ticket involved to be sure that it will fit everyone.

> give the user the possibility to switch between dark and light, and
store the choice

By doing this, you will have a way to disable the dark theme, even if you
have set your os preference on the dark theme, and the theme change will
be visible to everyone on the admin.

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:6>

Django

unread,
Jul 13, 2022, 8:28:25 AM7/13/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Sarah Abderemane):

[https://github.com/django/django/pull/15843 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:7>

Django

unread,
Jul 13, 2022, 9:58:22 AM7/13/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:8>

Django

unread,
Jul 14, 2022, 5:15:04 AM7/14/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:9>

Django

unread,
Jul 28, 2022, 6:16:04 AM7/28/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 1 => 0


Comment:

It looks like comments have been addressed. Unchecking PNI for another
review.

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:10>

Django

unread,
Aug 2, 2022, 9:50:51 AM8/2/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: dark theme | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:11>

Django

unread,
Aug 2, 2022, 12:04:38 PM8/2/22
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"bc7aa2a5e91cf65fc7510edaf1776528c7ad07b4" bc7aa2a5]:
{{{
#!CommitTicketReference repository=""
revision="bc7aa2a5e91cf65fc7510edaf1776528c7ad07b4"
Fixed #33690 -- Added switch button for dark mode in the admin.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:12>

Django

unread,
Nov 14, 2023, 11:26:55 PM11/14/23
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"640283711e6c8d25ad0e3c97453cd178a3e4d6a6" 64028371]:
{{{
#!CommitTicketReference repository=""
revision="640283711e6c8d25ad0e3c97453cd178a3e4d6a6"
Refs #33690 -- Added missing data-theme selector to example in theming
support docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:13>

Django

unread,
Nov 14, 2023, 11:28:13 PM11/14/23
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"effd704a1c19352f8d437ae3ed8852f4022133b4" effd704]:
{{{
#!CommitTicketReference repository=""
revision="effd704a1c19352f8d437ae3ed8852f4022133b4"
[5.0.x] Refs #33690 -- Added missing data-theme selector to example in
theming support docs.

Backport of 640283711e6c8d25ad0e3c97453cd178a3e4d6a6 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:14>

Django

unread,
Nov 14, 2023, 11:28:36 PM11/14/23
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"e9acdff46298f99a2f234a376f6177e7c3216e7d" e9acdff]:
{{{
#!CommitTicketReference repository=""
revision="e9acdff46298f99a2f234a376f6177e7c3216e7d"
[4.2.x] Refs #33690 -- Added missing data-theme selector to example in
theming support docs.

Backport of 640283711e6c8d25ad0e3c97453cd178a3e4d6a6 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:15>

Django

unread,
Jan 3, 2024, 4:18:08 PM1/3/24
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"c65f49d3cb8709f2f694f78b4849bc7693e90416" c65f49d]:
{{{
#!CommitTicketReference repository=""
revision="c65f49d3cb8709f2f694f78b4849bc7693e90416"
Refs #33690 -- Updated tutorial for admin dark mode toggle.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:16>

Django

unread,
Jan 3, 2024, 4:19:07 PM1/3/24
to django-...@googlegroups.com
#33690: Allow disabling admin module dark theme
-------------------------------------+-------------------------------------
Reporter: nv35 | Owner: Sarah
| Abderemane
Type: New feature | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: dark theme | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"ef8234aef8f8473cb4fb79aec29e5a9445a32114" ef8234a]:
{{{
#!CommitTicketReference repository=""
revision="ef8234aef8f8473cb4fb79aec29e5a9445a32114"
[5.0.x] Refs #33690 -- Updated tutorial for admin dark mode toggle.

Backport of c65f49d3cb8709f2f694f78b4849bc7693e90416 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33690#comment:17>

Reply all
Reply to author
Forward
0 new messages