Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django dark mode is not working #129

Open
tbhaxor opened this issue Aug 14, 2021 · 21 comments
Open

Django dark mode is not working #129

tbhaxor opened this issue Aug 14, 2021 · 21 comments
Assignees
Labels
enhancement New feature or request

Comments

@tbhaxor
Copy link

tbhaxor commented Aug 14, 2021

Python version
3.9

Django version
3.2.5

Package version
0.16.3

Current behavior (bug description)
Django default admin dark mode not working with django-admin-interface.

Expected behavior
I want to use the flat design provided by django-admin-interface but with dark mode

Fund with Polar
@tbhaxor tbhaxor added the bug Something isn't working label Aug 14, 2021
@fabiocaccamo
Copy link
Owner

@tbhaxor me too :), but this would require a lot of work and at the moment I have not the time for working on it.

@fabiocaccamo fabiocaccamo added enhancement New feature or request and removed bug Something isn't working labels Aug 15, 2021
@tbhaxor
Copy link
Author

tbhaxor commented Aug 15, 2021

Maybe i can help you. will check in upcoming weekend

@fabiocaccamo
Copy link
Owner

fabiocaccamo commented Aug 16, 2021

  • Many color fields must be added to give the possibility to customize all colors
  • Every color field should must become 2 color fields, 1 for light theme and another for the dark one

@tbhaxor
Copy link
Author

tbhaxor commented Aug 16, 2021

@fabiocaccamo Could you guide me on setting up development environment

@fabiocaccamo
Copy link
Owner

@tbhaxor just create a django project locally (you can follow the official django tutorial) and install the package without pip to be able to modify it. For testing check here.

@merwok
Copy link
Contributor

merwok commented Aug 16, 2021

I wonder if duplicating all the colour fields is the way to go here.

Would all the dark fields be required? Could be bothersome for a project that doesn’t need/want a dark mode. But if they are optional, then there could be fields left out by mistake, making an incomplete or unreadable theme.

What if Theme had a boolean field to indicate if it’s light or dark, and a one-to-one relation to theme table to indicate the “twin” theme to use according to browser mode?

@tbhaxor
Copy link
Author

tbhaxor commented Aug 16, 2021

We can have a switch or some selector giving users to create two themes one for dark and another for light

@fabiocaccamo
Copy link
Owner

fabiocaccamo commented Sep 24, 2021

@merwok it is surely a smart solution, maybe a little bit overcomplicated.

I'm guessing if in this case there is really the need to have an automatic switch between light and dark themes, in my opinion there is not, I don't care very much about the trends.

I would start by adding the fields to customise all the theme colors, in this way it will be possible to have also dark themes (including some predefined ones).

@saymoncoppi
Copy link

If you need help to do that pls let me know. Maybe I could help :)

@fabiocaccamo
Copy link
Owner

@saymoncoppi if you want to work on this you could start from here:

I would start by adding the fields to customise all the theme colors, in this way it will be possible to have also dark themes (including some predefined ones).

@notnotrachit
Copy link

Suggestion: Just add another color selector for background. Thats it

@san425
Copy link

san425 commented Nov 25, 2022

hey is this in any coming update or is it available right now? I'm not really looking for a dark mode, just the ability to choose my own background color. thanks :)

@merwok
Copy link
Contributor

merwok commented Nov 25, 2022

This is an open ticket, with no pull request linked.

@VaZark
Copy link
Contributor

VaZark commented Dec 14, 2022

What do you think of adding two active themes ? One can be used for the light mode and the other can be used for dark mode.

Django officially support browser preference, so we can use that var as a param to get_active_theme. Not sure how it is used but shouldn't be too hard to find

@fabiocaccamo
Copy link
Owner

fabiocaccamo commented Dec 14, 2022

@VaZark let's start by splitting the problem into smaller problems:

  • For supporting a completely custom dark theme, we must be able to customise all theme colors before, I don't think that changing only the background color is enough.

  • For managing the theme switching, I would allow users to flag two active themes, one for light and another one for dark theme.
    This can be easily achieved by adding an active_dark BooleanField without overcomplicating the database structure.

  • If users select only a light theme or only a dark theme, that theme will be always used.
    Alternatively if both themes (light and dark) have a selected theme, the theme that matches the user preferences will be used.

@Macktireh
Copy link

Hi,
As dark mode is becoming more of a standard feature, do you plan on adding support for dark mode, especially considering that Django already supports it?

@fabiocaccamo
Copy link
Owner

Hi @Macktireh
this issue is open because it's my intention to add dark mode support.

Generally I work on enhancements / features when I have enough free time or I need them on paid projects I'm working on.

If you really need this feature as soon as possible for a commercial project consider contributing to this open source project by submitting a pull-request, alternatively ask your boss to sponsor this project via GitHub sponsors.

@rob32
Copy link

rob32 commented Dec 19, 2023

@fabiocaccamo
What do you think of the idea of removing the button altogether? This could be quickly reversed later if necessary.

@fabiocaccamo
Copy link
Owner

@rob32 will be hidden in the next release.

@fabiocaccamo
Copy link
Owner

@rob32 it's hidden in 0.28.0 version.

@github-project-automation github-project-automation bot moved this from Todo to Done in Open Source Dec 21, 2023
@fabiocaccamo fabiocaccamo reopened this Dec 21, 2023
@fabiocaccamo fabiocaccamo moved this from Done to Todo in Open Source Dec 21, 2023
@dysphael
Copy link

up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

10 participants