You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ JAZZMIN_SETTINGS = {
22
22
# Logo to use for your site, must be present in static files, used for login form logo (defaults to site_logo)
23
23
"login_logo": None,
24
24
25
-
# Logo to use for login form in dark themes (defaults to login_logo)
25
+
# Logo to use when color scheme is dark (defaults to login_logo)
26
26
"login_logo_dark": None,
27
27
28
28
# CSS classes that are applied to the logo above
@@ -131,6 +131,8 @@ JAZZMIN_SETTINGS = {
131
131
"use_google_fonts_cdn": True,
132
132
# Whether to show the UI customizer on the sidebar
133
133
"show_ui_builder": False,
134
+
# Whether to show the theme chooser dropdown in the top navbar
135
+
"show_theme_chooser": False,
134
136
135
137
###############
136
138
# Change view #
@@ -343,7 +345,7 @@ class BookAdmin(admin.ModelAdmin):
343
345
You can enable a language chooser dropdown using `"language_chooser": True` in your `JAZZMIN_SETTINGS`, we mainly use this for
344
346
assisting with translations, but it could be of use to some people in their admin site.
345
347
346
-
To make proper use of this, please ensure you have internationalisation setup properly, See [https://docs.djangoproject.com/en/3.1/topics/i18n/translation/](https://docs.djangoproject.com/en/3.1/topics/i18n/translation/)
348
+
To make proper use of this, please ensure you have internationalisation setup properly, See [https://docs.djangoproject.com/en/stable/topics/i18n/translation/](https://docs.djangoproject.com/en/stable/topics/i18n/translation/)
Copy file name to clipboardExpand all lines: docs/ui_customisation.md
+37-26Lines changed: 37 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,57 +21,70 @@ into your settings that will persist these customisations beyond page refresh.
21
21
With the ui customiser enabled (see above), you can try out different bootswatch themes, and combine the theme with our
22
22
other UI tweaks.
23
23
24
-
### Dark mode enabled
24
+
### Color scheme (light / dark)
25
25
26
-
If you set `JAZZMIN_UI_TWEAKS["dark_mode_theme"]` to a dark theme, then users that have opted for dark mode on their
27
-
device will be served this theme instead of the one in `JAZZMIN_UI_TWEAKS["theme"]`
26
+
Any Bootswatch theme can be shown in light or dark. Jazzmin sets Bootstrap’s `data-bs-theme` on the `<html>` element
27
+
to `"light"` or `"dark"`, so the same theme adapts to the chosen color scheme.
28
28
29
-
This is done using `prefers-color-scheme` in the CSS media attribute, see [here](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
30
-
for more information on the web standard
29
+
-**`default_theme_mode`** in `JAZZMIN_UI_TWEAKS`: `"light"`, `"dark"`, or `"auto"`. With `"auto"`, the scheme follows
30
+
the system preference (`prefers-color-scheme`). Default is `"light"`.
31
+
- The UI customizer lets users switch between Light, Dark, and System; the choice is stored in `localStorage` and can be
32
+
copied into settings via “Show code”.
31
33
32
-
for example, to use `flatly` for all users that have no preference or prefer light mode, and `darkly` for those who opt
33
-
for dark mode on their device:
34
+
Example: default to dark, with one theme for everyone:
34
35
35
36
```python
36
37
JAZZMIN_UI_TWEAKS= {
37
38
...
38
39
"theme": "flatly",
39
-
"dark_mode_theme": "darkly",
40
+
"default_theme_mode": "dark",
40
41
}
41
42
```
42
43
43
-
To force the use of a single theme regardless, just omit `dark_mode_theme` from your `JAZZMIN_UI_TWEAKS`
44
+
Example: follow system preference:
44
45
45
-
You can preview any of the available themes on your site using the UI Customizer (See above), or view them on bootswatch
46
-
below
46
+
```python
47
+
JAZZMIN_UI_TWEAKS= {
48
+
...
49
+
"theme": "flatly",
50
+
"default_theme_mode": "auto",
51
+
}
52
+
```
47
53
48
-
### Light themes
54
+
**Migration from `dark_mode_theme`:** If you had `dark_mode_theme` set (e.g. `"darkly"`), it is deprecated and no longer used. For the same behaviour (dark theme when the user’s system prefers dark), set `default_theme_mode": "auto"` and remove `dark_mode_theme`. If you do not update your config, Jazzmin will treat existing `dark_mode_theme` as `default_theme_mode": "auto"` and log a deprecation warning.
49
55
50
-
- default (Standard theme built on top of bootstrap)
56
+
You can preview any of the available themes on your site using the UI Customizer (see above), or view them on bootswatch
0 commit comments