unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development
https://unfoldadmin.com
MIT License
1.62k stars 161 forks source link

Question: Global background style change #589

Closed dominikbullo closed 2 months ago

dominikbullo commented 2 months ago

Question: Is it possible to easily change the background style for light and dark modes?

Description

I am interested in changing the style of the background for both light and dark modes.

Questions

  1. Is it easily achievable to customize the background style globally for both light and dark modes?
  2. What would be the best approach to implement these changes in the current codebase?

Reasons

  1. The current background style may not align with the design requirements or aesthetic preferences of some users. Customizing the background for both light and dark modes can enhance the visual appeal and user experience.
  2. We would like to have different colored backgrounds for different environments (e.g., development, staging, production) to easily distinguish between them.

Thank you for considering this inquiry and for the fantastic job with this project! Looking forward to your feedback and guidance on how to proceed.

lukasvinclav commented 2 months ago

Hey Dominik,

for (2) you can check the environment label which can display the current environment name in top right corner. This is implemented directly in Unfold.

Regarding different themes, this is going to be more complex. Right now, we have only one dynamic color "bg-primary-" & "text-primary-" which is for changing default color (purple). But with your requirement, we need to completely refactor all backgrounds, borders, shadows and group them under "color schema" settings. I'm expecting weeks of work to get it done properly.

dominikbullo commented 2 months ago

Hello Lukas,

thank you for the answer :)

I know about that label and we're already using it. I've also customized the sidebar, but it seems that's still not enough 😅. Therefore, I'm searching for more radical options.

I'm also aware of completely changing the color scheme for each environment, though I'm not really sold on that idea. However, acknowledging your suggestion, maybe that’s the best way forward at this moment.

Do you think this will be on your roadmap in the future? If we're keen on the original idea, would the answer for when it might be possible be "never" or "in X time"? I'm asking mainly because if it's not planned, I might need to do it on my own.

lukasvinclav commented 2 months ago

Unless somebody is willing to financially support the development, this is not in the roadmap. The complexity of this task is very high.

There are two other options to distinguish between environments:

  1. implement prefix for title in browser tab which will look like [LOCAL] Admin, [STAG] Admin, [PROD] Admin
  2. making the environment label more visible by adding an option to display it as stripe at the very top of the page like https://github.com/dizballanze/django-admin-env-notice
dominikbullo commented 2 months ago

I will give it a try! Thank you so much once again for quick help :) Since my question was answered, I am closing this issue for now.

raayu83 commented 2 months ago

Also just considerung what to do about making the Environment easier to be noticed for safety reasons. Would love to see something along the lines of django-admin-env-notice. I supposed the plugin isn't compatible already?