Skip to content

Commit

Permalink
Rename 'theme_color' to 'color_mode'
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Apr 22, 2024
1 parent f95ed24 commit b1289e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The ``BOOTSTRAP5`` dict variable contains these settings and defaults:
"theme_url": None,
# Theme color: light, dark https://getbootstrap.com/docs/5.3/customize/color-modes/
"theme_color": "dark",
"color_mode": "dark",
# Put JavaScript in the HEAD section of the HTML document (only relevant if you use bootstrap5.html).
'javascript_in_head': False,
Expand Down
10 changes: 8 additions & 2 deletions example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,19 @@
"class": "django.utils.log.AdminEmailHandler",
}
},
"loggers": {"django.request": {"handlers": ["mail_admins"], "level": "ERROR", "propagate": True}},
"loggers": {
"django.request": {
"handlers": ["mail_admins"],
"level": "ERROR",
"propagate": True,
}
},
}

# Settings for django-bootstrap5
BOOTSTRAP5 = {
"error_css_class": "django_bootstrap5-error",
"required_css_class": "django_bootstrap5-required",
"javascript_in_head": True,
"theme_color": "dark",
"color_mode": "dark",
}
2 changes: 1 addition & 1 deletion src/django_bootstrap5/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"crossorigin": "anonymous",
},
"theme_url": None,
"theme_color": 'light',
"color_mode": "light",
"javascript_in_head": False,
"wrapper_class": "mb-3",
"inline_wrapper_class": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load django_bootstrap5 %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE|default:'en_us' }}" data-bs-theme="{{ 'theme_color'|bootstrap_setting }}">
<html lang="{{ LANGUAGE_CODE|default:'en_us' }}" data-bs-theme="{{ 'color_mode'|bootstrap_setting }}">

<head>

Expand Down

0 comments on commit b1289e5

Please sign in to comment.