libertysoft3 / saidit

The reddit open source fork powering SaidIt
https://saidit.net
Other
228 stars 39 forks source link

Chat is still dark in light mode #11

Closed waluigispear closed 5 years ago

waluigispear commented 5 years ago

The image

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.

wizzwizz4 commented 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.

libertysoft3 commented 5 years ago

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.

libertysoft3 commented 5 years ago

Resolved by https://github.com/libertysoft3/saidit/commit/c5ad6f41f213eab13c1a50b0ffc8b031be3ec45e

and https://github.com/libertysoft3/saidit/commit/c5ad6f41f213eab13c1a50b0ffc8b031be3ec45e