django-nested-inline icon indicating copy to clipboard operation
django-nested-inline copied to clipboard

change hardcoded css colors to utilize css vars

Open silentbugs opened this issue 3 years ago • 4 comments

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.

silentbugs avatar May 19 '21 22:05 silentbugs

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.

daniel-brenot avatar Apr 07 '22 22:04 daniel-brenot

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 avatar Jun 23 '22 02:06 silentbugs

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

cosmofactory avatar Sep 28 '23 11:09 cosmofactory