JavaScript is required to toggle light/dark mode..
The function creates a backup of the last configuration of database to be returned in case needed.