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
In bootstrap4/templatetags/bootstrap4.py, there's a function bootstrap_message_classes which figures out what classes to assign to a Bootstrap Alert generated from a Django message. Right now, it makes the obvious mappings, except for two:
message_constants.DEBUG is mapped to alert-warning, and
messages without a proper level set get alert-danger.
Personally, I'd like DEBUG mapped to alert-secondary (gray background) and the default to be alert-primary (darker blue background) because I don't want things that aren't warnings or errors to look like them. Others might want to use alert-light or alert-dark. But there's no obvious way to change this. Monkeypatching the function might not work because @register.filter would still register the old one. Maybe I could alter MESSAGE_LEVEL_CLASSES, but is that the right way?
The text was updated successfully, but these errors were encountered:
The 99 is the value I use to test the default case. Needless to say, this doesn't really change the default styling, and one would need to find all the messages that didn't use constants and set values for them in the dict.
This really needs to be something we can set in settings.BOOTSTRAP4.
In
bootstrap4/templatetags/bootstrap4.py
, there's a functionbootstrap_message_classes
which figures out what classes to assign to a Bootstrap Alert generated from a Django message. Right now, it makes the obvious mappings, except for two:message_constants.DEBUG
is mapped toalert-warning
, andalert-danger
.Personally, I'd like
DEBUG
mapped toalert-secondary
(gray background) and the default to bealert-primary
(darker blue background) because I don't want things that aren't warnings or errors to look like them. Others might want to usealert-light
oralert-dark
. But there's no obvious way to change this. Monkeypatching the function might not work because@register.filter
would still register the old one. Maybe I could alterMESSAGE_LEVEL_CLASSES
, but is that the right way?The text was updated successfully, but these errors were encountered: