#33182: Enable dark mode in a easy way
-------------------------------------+-------------------------------------
     Reporter:  Matteo Vitali        |                    Owner:  Matteo
         Type:                       |  Vitali
  Cleanup/optimization               |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  admin dark schema    |             Triage Stage:  Accepted
  css ui ux                          |
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  1                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  1
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

 So this is a follow-up to #31259 which added the dark theme after #32018
 allowed theming via CSS vars.

 [https://stackoverflow.com/questions/67135053/can-someone-explain-to-my-
 why-my-django-admin-theme-is-dark This Stack Overflow thread captures the
 issues people have].

 * How to disable (whilst keeping `prefers-color-scheme` set to dark?🤔)
 * Where/how exactly to override.

 The PR moves the dark theme variable definitions into their own file, and
 adds an AdminSite attribute for that.

 Probably just a `block` is enough.

 Then in [https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#admin-
 theming the Theming Support] docs:

 * Link `template override` in the first paragraph to the
 [https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#overriding-
 admin-templates Overriding Admin Templates] docs.
 * Move the "A dark theme..." paragraph to a new subsection below "The list
 of CSS variables..."]
 * Then add the file the vars are defined in, and mention the block that
 can be overridden to replace these, or skip the stylesheet entirely.
 * Add a `versionchanged` for the variables being move to a separate
 stylesheet.

 That should cover it.

 I'm not sure we have automated tests for this. Manual testing will have to
 do.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.41ee604400400c6fc4dcb81efc20dda1%40djangoproject.com.

Reply via email to