From b5cef91a91c9dbb697b65ef978a7de0b2c5cf564 Mon Sep 17 00:00:00 2001 From: mimi89999 Date: Tue, 12 Jan 2021 09:59:40 +0100 Subject: Fixed #31259 -- Added admin dark theme. --- docs/ref/contrib/admin/index.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index aaf5134395..c6135ca5cb 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2853,6 +2853,8 @@ creating your own ``AdminSite`` instance (see below), and changing the Theming support =============== +.. versionadded:: 3.2 + The admin uses CSS variables to define colors. This allows changing colors without having to override many individual CSS rules. For example, if you preferred purple instead of blue you could add a ``admin/base.html`` template @@ -2873,7 +2875,12 @@ override to your project: {% endblock %} -An up-to-date list of CSS variables is at +A dark theme is defined, and applied respecting the `prefers-color-scheme`_ +media query. + +.. _prefers-color-scheme: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme + +The list of CSS variables are defined at :file:`django/contrib/admin/static/admin/css/base.css`. ``AdminSite`` objects -- cgit v1.3