netzkolchose / django-treewidget

treewidget for django admin
MIT License
22 stars 5 forks source link

Django 3.2 admin dark mode #14

Open elmcrest opened 3 years ago

elmcrest commented 3 years ago

Hey netzkolchose,

can you say something about the state of dark mode support? it seems you've already, at least, started with this and there are CSS files for dark mode, but somehow it's not getting used.

Would you consider to support this and update your package?

Thx so far, really cool widget, I'm using it in a playground prototype kind of thing with django-treebeard.

jerch commented 3 years ago

That dark theme is a default one delivered with jstree. Never used it myself, thus it is possible, that it will not work out of the box (might need color fixes in default.css as well). You can activate it by explicitly setting $.jstree.defaults.core.themes.name to its theme name.

Imho to get the automatic switching as supported by Django 3.2+ more work is needed - you'd basically have to set the theme name during runtime based on the prefers-color-scheme media query. I have no system to test that, so please feel free to make a PR for that.