Closed waluigispear closed 5 years ago
This can be accomplished via window.postMessage
and storing a cookie.
Actually, I might see if I could write some code to do this (providing a light mode already exists for chat) – a lack of a development environment on my end will restrict my ability to test that code, though.
The TheLounge theme setting is stored in local storage in key 'settings'. The day theme/default theme is called 'example'. When I change this local storage data and reload, I see the new theme, yay.
But what should saidit do, check this local storage data on every page load? And can js even access local storage for a different port number (same domain)? What about a subdomain? Another approach is to hack TheLounge to accept a 'theme' url parameter that saidit would add to the chat iframe url.
It would be cool if TheLounge could change themes with a message from the outside too, for smashing on the day/night toggle.
Above is a screenshot of the Saidit website (cropped to show just the chat box and that I am in light mode).
In light mode, the chat box retains its dark theme. The expected behavior is that the chat box switches to a light theme, as does the rest of the site.
I'm running Chrome 73 on Windows 7.