sijad I've thought of this issue as well while working on theming for HumHub, and I've not been able to do much on this issue myself, I at the moment use the following to toggle between two different CSS files.
<form id="switchform">
<a href="javascript:chooseStyle('none', 60)" checked="checked"><i class="fa fa-sun-o"></i></a>
<a href="javascript:chooseStyle('dark-theme', 60)"<i class="fa fa-moon-o"></i></a>
</form>
While this does work, it requires two different CSS files to be called. none
is seen as the default theme display while dark-theme
is the one everyone wishes to switch to for dark mode.