you can use Page.server_info.user_settings.theme variable
This is something that should go in the Documentation :D
...in fact user settings isn't even in the documentation lol
Thanks @anoadragon453 for this script:
/Detect ZeroNet theme and apply the style according to it/
zeroFrame.cmd("serverInfo", {}, (server_info) => {
// Print server_info to the console
console.log("Server info:", server_info)// Retrieve the document body const body = document.body // Check user_settings exists if (!server_info.user_settings) { // Exit this function if it doesn't return } // Depending on user theme settings, set the theme switch(server_info.user_settings.theme) { case "light": body.innerHTML = '<style>lighttheme</style>' + body.innerHTML break case "dark": body.innerHTML = '<style>darktheme</style>' + body.innerHTML break default: console.log("Theming not supported. Please upgrade your ZeroNet version.") }})