Skip to content

Conversation

silentbugs
Copy link

The chosen variables are the ones that django uses for each of those elements, and ideally can also be omitted entirely in a future commit.

This helps integrate django-nested-inline with django admin's new dark theme, as well as custom themes that are written around django admin's css vars.

@daniel-brenot
Copy link
Collaborator

Can you make sure this will also work for older django versions? I like the use of css vars and this will end up being quite useful in my use case as well, but i'm worried about compatability with older django versions that don't define values for those variables.

@silentbugs
Copy link
Author

I can't think of a neat way to have this work for versions that don't define css variables, other than maintaining two copies of the CSS files and serving whichever one suits the django version that the project is running, similar to js loading:

admin.py

css = {
    "all": ('admin/css/forms-nested%s.css' % ('' if VERSION < (3,2) else 'vars'),)
}

This however causes an issue with having to maintain both versions of the css file.

Can you think of a more elegant solution?

@silentbugs silentbugs force-pushed the admin_theme_colors branch from db43b2b to 05a9a37 Compare June 14, 2023 19:29
@cosmofactory
Copy link

Guys, these changes are great, exactly what I'm looking for. Merge would be nice.

the chosen variables are the ones that django uses for each of those elements, and ideally can also be omitted entirely in a future commit
@silentbugs
Copy link
Author

@daniel-brenot Since there hasn't come up a more elegant way of doing this, I've decided to add a second version of the old CSS file with the colors defined. Please review this with older versions of django as well.

@browniebroke
Copy link

This package is super useful, and would love to see this released. For now, I've copied the CSS file into my project and pointed my admin class at it, and it works great. Anything else folks can do to help get this released to the world 😄?

PS: several Django versions were released since this was opened and the older versions that require hardcoding variables are all EOL as far as I know...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants