Closed Ehco1996 closed 6 days ago
Thanks for detailed explanation. Can you create a PR with a proposal how to get a behavior okay on regular frontend and admin area? Just working example will be good enough and I will adjust details.
@Ehco1996 any update?
@lukasvinclav Apologies for the delayed response; I've drafted a PR here: https://github.com/unfoldadmin/django-unfold/pull/669
To be honest, I never used MESSAGE_TAGS
before but after reading the documentation, I think, the only required action on my side is to add CSS class into messages.
Unfold is going to support all default message types and to support your custom classes, you must write your own CSS. In Unfold you can load your own CSS without any issues. If your own CSS class does not have any styling, the default one (gray) will be used.
Message class added here #725
Issue Description:
Do you have any examples?
When customizing message tags to support Bulma CSS on the user side, as shown below:
The messages in the admin interface lose their CSS support.
Is it a third party application feature request?
No, it is not a third-party application feature request.
In case of third party application, when it was updated last time?
The application was last updated last week.
Describe your feature request
The issue arises due to a hardcoded check for tags in the template file:
unfold/templates/unfold/helpers/messages.html
To resolve this, the hardcoded tag check should be removed or modified to accommodate custom message tags, ensuring that the CSS support is maintained both in the user interface and the admin interface.
Proposed Solution:
Modify the template to avoid hardcoding specific tag checks, allowing for flexibility in message tag customization. This will ensure that custom tags, such as those for Bulma CSS, are properly rendered without losing CSS support in the admin interface.
Additional Context:
This issue affects users who wish to customize message tags for CSS frameworks like Bulma while maintaining the functionality and styling in the admin interface. By addressing the hardcoded tag checks, the application can provide a more flexible and user-friendly experience.